__HappY__ @ 2023-07-08 15:00:56
#include<bits/stdc++.h>
using namespace std;
struct st{
string nm;
int wcj;
int scj;
int ycj;
int zf;
} a[2000];
int n;
int cmp(st a,st b)
{
return a.zf>b.zf;
}
int main()
{
cin>>n;
int i;
for(int i=0;i<n;i++)
{
cin>>a[i].nm>>a[i].wcj>>a[i].scj>>a[i].ycj;
a[i].zf=a[i].wcj+a[i].scj+a[i].ycj;
}
sort(a,a+n,cmp);
cout<<a[i].nm<<' '<<a[i].wcj<<' '<<a[i].scj<<' '<<a[i].ycj;
return 0;
}
by Hybrid_kittens @ 2023-07-09 09:19:34
"如果有多个总分相同的学生,输出靠前的那位。"
by Hybrid_kittens @ 2023-07-09 09:20:19
你看看是不是这个?