p5740(洛谷)

#include<bits/stdc++.h>
using namespace std;
struct student{
	string name;
	int sum,chinese,english,math;
};
int n,ans=0;
int main(){
	cin>>n;
	student s[1005];
	for(int i=0;i<n;i++){
		cin>>s[i].name>>s[i].chinese>>s[i].math>>s[i].english; 
		s[i].sum=s[i].math+s[i].english+s[i].chinese;
	}
	for(int i=0;i<n;i++){
		if(s[ans].sum<s[i].sum){
			ans=i;
		}
	}
	cout<<s[ans].name<<" "<<s[ans].chinese<<" "<<s[ans].math<<" "<<s[ans].english;
	return 0;
}