我刚好做完这个作业
#include
#include
using namespace std;
class student
{
public:
int score;
string name;
int no;
};
student *max(student *p,int num)
{
int a=0;
int max=p[a].score;
for(int i=0;i
max=p[i].score;
a=i;
}
}
return p+a;
}
student *min(student *p,int num)
{
int b=0;
int min=p[b].score;
for(int i=0;i
b=i;
}
}
return p+b;
}
void main()
{ int num;
cout<<"输入人数"<
student *p=new student[num];
for(int i=0;i
}
cout<<"最高成绩人姓名"<<(max(p,num))->name<<"学号:"<<(max(p,num))->no<<"成绩"<<(max(p,num))->score<
}