初音未来 • 3个月前
#include <bits/stdc++.h>
using namespace std;
struct man {
string s;
int c1;
int c2;
char a;
char b;
int num;
int p;
};
man t[105];
int main() {
int n, price = 0;
cin >> n;
int j = 0;
string r;
for (int i = 0; i < n; i++) {
t[i].p = 0;
cin >> t[i].s >> t[i].c1 >> t[i].c2 >> t[i].a >> t[i].b >> t[i].num;
if (t[i].num >= 1 && t[i].c1 > 80)
t[i].p += 8000;
if (t[i].c1 > 85 && t[i].c2 > 80)
t[i].p += 4000;
if (t[i].c1 > 90)
t[i].p += 2000;
if (t[i].c1 > 85 && t[i].b == 'Y')
t[i].p += 1000;
if (t[i].c2 > 80 && t[i].a == 'Y')
t[i].p += 850;
price += t[i].p;
}
//sort(t, t + n, cmp);
for (int i = 0; i < n; i++) {
if (j < t[i].p) {
j = t[i].p;
r = t[i].s;
}
}
cout << r << "\n" << j << "\n" << price;
return 0;
}
评论:
请先登录,才能进行评论