Back
Kiem_Tra_Cau_Truc.cpp
Save
// Kiem_Tra_Cau_Truc.cpp #include
using namespace std; struct MonHoc { char TenMon[30]; float SoTrinh, Diem; }; struct SinhVien { char MaSV[30]; char TenSV[50]; char Lop[10]; int Khoa, SoMonHoc; MonHoc mh[20]; float DiemTB; }; void nhapPhieu(SinhVien &sv) { cout<<"Nhap ma sinh vien: "; fflush(stdin); gets(sv.MaSV); cout<<"Nhap ten sinh vien: "; fflush(stdin); gets(sv.TenSV); cout<<"Nhap lop: "; fflush(stdin); gets(sv.Lop); cout<<"Nhap khoa hoc: "; cin>>sv.Khoa; cout<<"Nhap so mon hoc: "; cin>>sv.SoMonHoc; sv.DiemTB = 0; for (int i = 0; i < sv.SoMonHoc; i++) { cout<<"\nMon hoc "<
>sv.mh[i].SoTrinh; cout<<"Nhap diem: "; cin>>sv.mh[i].Diem; sv.DiemTB += sv.mh[i].Diem; } sv.DiemTB /= sv.SoMonHoc; } void inPhieu(SinhVien sv) { cout<<"\t\t\tPHIEU BAO DIEM"<