#include <iostream>
#include <cstdlib>
#include <stdio.h>
#include <algorithm>
using namespace std;
struct stu
{
string name;
int no;
int score, score_2, paper, money = 0;
char leader, western;
}student[105];
bool cmp(const stu &s1, const stu &s2)
{
if(s1.money == s2.money)
return s1.no < s2.no;
else
return s1.money > s2.money;
}
int main()
{
int n;
scanf("%d", &n);
long long sum = 0;
for(int i = 1; i <= n; ++i)
{
cin >> student[i].name >> student[i].score >> student[i].score_2 >> student[i].leader >> student[i].western >> student[i].paper;
student[i].no = i;
if(student[i].paper >= 1 && student[i].score > 80)
student[i].money += 8000;
if(student[i].score > 85 && student[i].score_2 > 80)
student[i].money += 4000;
if(student[i].score > 90)
student[i].money += 2000;
if(student[i].score > 85 && student[i].western == 'Y')
student[i].money += 1000;
if(student[i].score_2 > 80 && student[i].leader == 'Y')
student[i].money += 850;
}
for(int i = 1; i <= n; ++i)
sum += student[i].money;
sort(student+1, student+1+n, cmp);
/*int maxn = 0, number;
for(int i = 1; i <= n; ++i)
{
if(student[i].money > maxn)
{
maxn = student[i].money;
number = i;
}
}
*/
cout << student[1].name << endl;
cout << student[1].money << endl;
cout << sum << endl;
return 0;
}
tyvj p1002- 谁拿了最多奖学金
最新推荐文章于 2024-04-01 00:19:06 发布