class student
{
protected:
int name;
int individualStuNo;
int score;
public:
student();
~student();
void setindividualStuNo(int);
void setname(int);
void setscore(int);
int GetindividaulStuNo();
int Getname();
int Getscore();
};
student::student()
{
individualStuNo=0;
}
student::~student(){}
int student::Getname()
{ return name;}
int student::GetindividaulStuNo()
{ return individualStuNo;}
int student::Getscore()
{ return score;}
void student::setname(int _name){this->name = _name;}
void student::setscore(int _score){this->score = _score;}
void student::setindividualStuNo(int _individualStuNo){this->individualStuNo = _individualStuNo;}
#include<iostream>
using namespace std;
int main()
{
student s1;
student s2;
student s3;
student s4;
cout<<"请输入下一个学生的姓名:";
int name;
cin>>name;
cout<<"请输入此学生的
学号:";
int individualStuNo;
cin>>individualStuNo;
cout<<"请输入此学生的成绩:";
int score;
cin>>score;
s1.setname(name);
s1.setindividualStuNo(individualStuNo);
s1.setscore(score);
int a,b,c;
cout<<"请输入下一个学生的姓名:";
cin>>a;
cout<<"请输入此学生的学号:";
cin>>b;
cout<<"请输入此学生的成绩:";
cin>>c;
s2.setname(a);
s2.setindividualStuNo(b);
s2.setscore(c);
cout<<"请输入下一个学生的姓名:";
cin>>a;
cout<<"请输入此学生的学号:";
cin>>b;
cout<<"请输入此学生的成绩:";
cin>>c;
s3.setname(a);
s3.setindividualStuNo(b);
s3.setscore(c);
cout<<"请输入下一个学生的姓名:";
cin>>a;
cout<<"请输入此学生的学号:";
cin>>b;
cout<<"请输入此学生的成绩:";
cin>>c;
s4.setname(a);
s4.setindividualStuNo(b);
s4.setscore(c);
cout<<"姓名"<<s1.Getname() <<" 学号为"<<s1.GetindividaulStuNo()<<" 成绩为"<<s1.Getscore()<<endl;
cout<<"姓名"<<s1.Getname()
<<" 学号为"<<s1.GetindividaulStuNo()<<" 成绩为"<<s1.Getscore()<<endl;
cout<<"姓名"<<s1.Getname()
<<" 学号为"<<s1.GetindividaulStuNo()<<" 成绩为"<<s1.Getscore()<<endl;
cout<<"姓名"<<s1.Getname()
<<" 学号为"<<s1.GetindividaulStuNo()<<" 成绩为"<<s1.Getscore()<<endl;
return 0;
}