- BC20270418's blog
题解(不用谢)
- 2024-12-21 16:06:23 @
#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;
}