You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
497 B
20 lines
497 B
#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;
|
|
} |