第三个测试点没过,请大佬帮帮忙
#include<bits/stdc++.h>
using namespace std;
int n;
struct inf{
char name[8];
int Chi;
int mat;
int Eng;
int tot;
}stu[1001];
int cmp(inf x,inf y){
return x.tot>y.tot;
}
int main(){
scanf("%d",&n);
for (int i=1;i<=n;i++){
scanf("%s %d %d %d",&stu[i].name,&stu[i].Chi,&stu[i].mat,&stu[i].Eng);
stu[i].tot=stu[i].Chi+stu[i].mat+stu[i].Eng;
}
sort(stu+1,stu+1+n,cmp);
printf("%s %d %d %d",stu[1].name,stu[1].Chi,stu[1].mat,stu[1].Eng);
return 0;
}
orz