P5740 【深基7.例9】最厉害的学生
#include <bits/stdc++.h>
using namespace std;
struct Student {
string Name;
int chinese;
int math;
int english;
} a, ans;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a.Name >> a.chinese >> a.math >> a.english;
if (a.chinese + a.math + a.english > ans.chinese + ans.math + ans.english) ans = a;
}
cout << ans.Name << " " << ans.chinese << " " << ans.math << " " << ans.english << endl;
return 0;
}