- 谁拿了最多奖学金
- 2021-10-22 13:11:44 @
#include <iostream>
#include <string>
using namespace std;
string name[100],c1,c2;
int p1[100],p2[100],cnt[100],n,maxty=-1, maxMoney=-1,tmpMoney,sumMoney=0;
bool b1[100],b2[100];
int main()
{
cin >> n;
for (int i = 0; i < n; i ++)
{
cin >> name[i] >> p1[i] >> p2[i] >> c1 >> c2 >> cnt[i];
b1[i] = (c1[0] == 'Y');
b2[i] = (c2[0] == 'Y');
tmpMoney = 0;
if (p1[i] > 80 && cnt[i] >= 1)
tmpMoney += 8000;
if (p1[i] > 85 && p2[i] > 80)
tmpMoney += 4000;
if (p1[i] > 90)
tmpMoney += 2000;
if (p1[i] > 85 && b2[i] == true)
tmpMoney += 1000;
if (p2[i] > 80 && b1[i] == true)
tmpMoney += 850;
if (tmpMoney > maxMoney) {
maxMoney = tmpMoney;
maxty=i;
}
sumMoney += tmpMoney;
}
cout << name[maxty] << endl;
cout << maxMoney << endl;
cout << sumMoney << endl;
return 0;
}