- 谁拿了最多奖学金
- 2024-08-04 15:46:50 @
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
pair<string, int> p[110];
int teas;
int cs;
char vol;
char iws;
int ess;
bool cmp(pair<string, int>x, pair<string, int>y){
return x.second < y.second;
}
int main(){
std::ios::sync_with_stdio(0);
// freopen("input.in", "r", stdin);
int n;
int result = 0;
cin >> n;
for (int i = 1; i <= n; i++){
// Name
cin >> p[i].first >> teas >> cs >> vol >> iws >> ess;
p[i].second = 0;
// Term-end average score
if (teas > 90) p[i].second += 2000;
// class score and if is volunteer
if (cs > 80 && vol == 'Y') p[i].second += 850;
// western student
if (iws == 'Y' && teas > 85) p[i].second += 1000;
// 5 4
if (teas > 85 && cs > 80) p[i].second += 4000;
// essay
if (ess >= 1 && teas > 80) p[i].second += 8000;
result += p[i].second;
}
sort(p+1, p+n+1, cmp);
cout << p[n].first << endl << p[n].second << endl << result << endl;
return 0;
}
1 条评论
-
EddieLi LV 8 @ 2024-08-05 11:53:49
第一眼:卧槽,gpt,作弊
第二眼:好像,貌似还真是自己写的
- 1