int M=100; static int M2=0; class Score{ //分数类 private: int score; public: Score(int s=0){ score=s; } void set1(){ cout<<"请输入分数:"<<endl; cin>>score; } void show1(){ cout<<": "<<score<<endl; } };
class Subject{ //科目类 private: Score sc; char subject[20]; public: Subject(){ for(int i=0;i<20;i++) subject[i]=0; } void set2(){ cout<<"请输入科目名称:"<<endl; cin>>subject; sc.set1(); } void show2(){ cout<<subject; sc.show1(); } };
class Student{ private: Subject p1[8]; char name[20];
//学生类