社区讨论
0分全WA
P1051[NOIP 2005 提高组] 谁拿了最多奖学金参与者 1已保存回复 0
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 0 条
- 当前快照
- 1 份
- 快照标识符
- @loy6e2l7
- 此快照首次捕获于
- 2023/11/14 18:13 2 年前
- 此快照最后确认于
- 2023/11/14 19:58 2 年前
CPP
#include<bits/stdc++.h>
using namespace std;
int n;
string win;
int num;
int he;
int sum;
int maxx;
struct jiangxuejing{
string name;
int qimuopts;
int classpts;
char ganbu;
char west;
int lunwen;
long long money;
}a[105];`
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i].name>>a[i].qimuopts>>a[i].classpts>>a[i].ganbu>>a[i].west>>a[i].lunwen;
if(a[i].qimuopts>80&&a[i].lunwen>=1){
a[i].money+=8000;
}
else if(a[i].qimuopts>85&&a[i].classpts>80){
a[i].money+=4000;
}
else if(a[i].qimuopts>90){
a[i].money+=2000;
}
else if(a[i].west=='Y'&&a[i].qimuopts>85){
a[i].money+=1000;
}
else if(a[i].classpts>80&&a[i].ganbu=='Y'){
a[i].money+=850;
}
if(maxx<a[i].money){
maxx=a[i].money;
i=num;
}
sum+=a[i].money;
}
cout<<a[num].name<<endl<<maxx<<endl<<sum;
return 0;
}
回复
共 0 条回复,欢迎继续交流。
正在加载回复...