提交时间:2025-05-10 14:42:30

运行 ID: 321492

#include<bits/stdc++.h> using namespace std; struct sgh { string n; int m, c, e, g; int t; }s[40]; bool cmp(sgh x, sgh y) { return x.t > y.t; } int main() { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> s[i].n >> s[i].m >> s[i].c >> s[i].e >> s[i].g; s[i].t = s[i].m + s[i].c+ s[i].e + s[i].g; } sort(s, s + n, cmp); for (int i = 0; i < 3; i++) { cout << s[i].n << endl; } return 0; }