/*用c++写关于求学生成绩最高分的类,主函数中输入5个名字和成绩*/
#include
#include
using namespace std;
class Student
{
public:
string name;
int score;
Student()
{}
void input()
{
cin>>name>>score;
}
void show()
{
cout<
};
int main()
{
Student stu[5];
cout<<"请输入5个数据:"<
{
stu[i].input();
}
int max = stu[0].score;
int n=0;
for(int j=0;j<5;j++)
{
if(max
max = stu[j].score;
n=j;
}
}
cout<<"The max is :"<
return 0;
}