qwq
我来水一篇题解
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 102;
struct stu{
int id;
string name;
int w;
}a[N];
bool cmp(stu x,stu y)
{
if(x.w == y.w) return x.id < y.id;
return x.w > y.w;
}
int main()
{
int n;
int ans = 0;
cin >> n;
for(int i = 1;i <= n;i ++)
{
int x,y,ok;
char an,bn;
cin >> a[i].name >> x >> y >> an >> bn >> ok;
a[i].id = i;
a[i].w = 0;
if(x > 80 && ok) a[i].w += 8000;
if(x > 85 && y > 80) a[i].w += 4000;
if(x > 90) a[i].w += 2000;
if(x > 85 && bn == 'Y') a[i].w += 1000;
if(y > 80 && an == 'Y') a[i].w += 850;
ans += a[i].w;
}
sort(a + 1,a + 1 + n,cmp);
cout << a[1].name << endl;
cout << a[1].w << endl;
cout << ans << endl;
return 0;
}
问一问的好啊!