#include <iostream>
#include <string>
using namespace std;
struct sinhvien
{
string tensv;
string masinhvien;
float diemtb;
} ;
int main( ) {
sinhvien sv;
int n;
cout << "nhap vao so luong sinh vien : " ;
cin >> n;
fflush ( stdin ) ;
for ( int i = 0 ; i < n; i++ ) {
cout << "nhap vao thong tin sinh vien thu " << i + 1 << " : " << endl;
cout << "nhap vao ten sinh vien : " ;
getline( cin , sv.tensv ) ;
cout << "nhap vao ma sinh vien: " ;
getline( cin , sv.masinhvien ) ;
cout << "nhap vao diem : " ;
cin >> sv.diemtb ;
cout << endl << endl << endl;
fflush ( stdin ) ;
}
for ( int i = 0 ; i < n; i++ )
{
cout << "sinh vien thu " << i + 1 << " : " << endl;
cout << "ten :" << sv.tensv << endl;
cout << "ma sinh vien : " << sv.masinhvien << endl;
cout << "dien trung binh mon : " << sv.diemtb << endl;
fflush ( stdin ) ;
system ( "pause" ) ;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnN0cnVjdCBzaW5odmllbgp7CglzdHJpbmcgdGVuc3Y7CglzdHJpbmcgbWFzaW5odmllbjsKCWZsb2F0IGRpZW10YjsKCn07CgppbnQgbWFpbigpewoKCXNpbmh2aWVuIHN2OwoJaW50IG47Cgljb3V0IDw8ICJuaGFwIHZhbyBzbyBsdW9uZyBzaW5oIHZpZW4gOiAiOwoJY2luID4+IG47CglmZmx1c2goc3RkaW4pOwoJZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspewoJCWNvdXQgPDwgIm5oYXAgdmFvIHRob25nIHRpbiBzaW5oIHZpZW4gdGh1ICIgPDwgaSArIDEgPDwgIiA6ICIgPDwgZW5kbDsKCQljb3V0IDw8ICJuaGFwIHZhbyB0ZW4gc2luaCB2aWVuIDogIjsKCQlnZXRsaW5lKGNpbiwgc3YudGVuc3YpOwoJCWNvdXQgPDwgIm5oYXAgdmFvIG1hIHNpbmggdmllbjogICI7CgkJZ2V0bGluZShjaW4sIHN2Lm1hc2luaHZpZW4pOwoJCWNvdXQgPDwgIm5oYXAgdmFvIGRpZW0gOiAiOwoJCWNpbiA+PiBzdi5kaWVtdGI7CgkJY291dCA8PCBlbmRsIDw8IGVuZGwgPDwgZW5kbDsKCQlmZmx1c2goc3RkaW4pOwoKCgl9CgoJZm9yIChpbnQgIGkgPSAwOyBpIDwgbjsgaSsrKQoJewoJCWNvdXQgPDwgInNpbmggdmllbiB0aHUgIiA8PCBpICsgMSA8PCAiIDogIiA8PCBlbmRsOwoJCWNvdXQgPDwgInRlbiA6IiA8PCBzdi50ZW5zdiA8PCBlbmRsOwoJCWNvdXQgPDwgIm1hIHNpbmggdmllbiA6ICIgPDwgc3YubWFzaW5odmllbiA8PCBlbmRsOwoJCWNvdXQgPDwgImRpZW4gdHJ1bmcgYmluaCBtb24gOiAiIDw8IHN2LmRpZW10YiA8PCBlbmRsOwoJCWZmbHVzaChzdGRpbik7CgkJc3lzdGVtKCJwYXVzZSIpOwoJfQoKCn0=
compilation info
prog.cpp:20:9: error: use of undeclared identifier 'stdin'
fflush(stdin);
^
prog.cpp:30:10: error: use of undeclared identifier 'stdin'
fflush(stdin);
^
prog.cpp:41:10: error: use of undeclared identifier 'stdin'
fflush(stdin);
^
prog.cpp:42:3: error: use of undeclared identifier 'system'
system("pause");
^
4 errors generated.
stdout