#include <bits/stdc++.h>
using namespace std;
int n,e,m,c;
struct node{
string name;
int number,all,e,m,c;
}a[1005];
bool cmp(node x,node y){
if(x.all!=y.all){
return x.all>y.all;
}else{
return x.number>y.number;
}
}
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i].name>>a[i].c>>a[i].m>>a[i].e;
a[i].all=e+m+c;
}
sort(a+1,a+1+n,cmp);
cout<<a[1].name<<" "<<a[1].c<<" "<<a[1].m<<" "<<a[1].e;
return 0;
}
帮我必关注