fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. string nama, kelas, sekolah;
  8.  
  9. cout << "Muhammad Vino Arendy: ";
  10. getline(cin, nama);
  11.  
  12. cout << " 12B: ";
  13. getline(cin, kelas);
  14.  
  15. cout << "SMAN 2 MEMPAWAH HLIR: ";
  16. getline(cin, sekolah);
  17.  
  18. cout << endl;
  19. cout << "===== DATA SISWA =====" << endl;
  20. cout << "Muhammad Vino Arendy" << nama << endl;
  21. cout << "12B" << kelas << endl;
  22. cout << "SMAN 2 MEMPAWAH HILIR" << sekolah << endl;
  23.  
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0.01s 5328KB
stdin
Standard input is empty
stdout
Muhammad Vino Arendy:  12B: SMAN 2 MEMPAWAH HLIR: 
===== DATA SISWA =====
Muhammad Vino Arendy
12B
SMAN 2 MEMPAWAH HILIR