#include <iostream>
using namespace std;
int main() {
struct student
{
char name[30];
int num;
float score;
}stu[3];
student *p=stu;
float max;
max=p->score;
for(;p<stu+3;p++)
{
cout<<"请输入三个学生信息:"<<endl;
cout<<"姓名:"<<endl; cin.get(p->name,30);
cout<<"学号:"<<endl; cin>>p->num;
cout<<"分数:"<<endl; cin>>p->score;
cin.get();
}
for(p=stu;p<stu+3;p++)
{
if(p->score>max)
max=p->score;
}
cout<<"-----------------------";
cout<<"最高分是:"<<max<<endl;
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: