谁拿了最多奖学金题解
2024-10-05 10:42:18
发布于:北京
0阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int n,x,y,z,sum,reward,max_reward;
string name,max_name;
char c1,c2;
int main(){
cin >> n;
for(int i = 1; i <= n;++ i){
reward = 0;
cin >> name >> x >> y >> c1 >> c2 >> z;
if(x > 80 && z >= 1) reward += 8000;
if(x > 85 && y > 80) reward += 4000;
if(x > 90) reward += 2000;
if(c2 == 'Y' && x > 85) reward += 1000;
if(c1 == 'Y' && y > 80)reward += 850;
if(reward > max_reward){
max_name = name;
max_reward = reward;
}
sum += reward;
}
cout << max_name << endl << max_reward << endl << sum << endl;
return 0;
}
这里空空如也
有帮助,赞一个