社区讨论

请教大佬们,能过样例,但测试点全WA

P1051[NOIP 2005 提高组] 谁拿了最多奖学金参与者 2已保存回复 4

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
4 条
当前快照
1 份
快照标识符
@mi6v1q4e
此快照首次捕获于
2025/11/20 11:17
4 个月前
此快照最后确认于
2025/11/20 11:17
4 个月前
查看原帖
CPP
#include <iostream>
#include<string>
using namespace std;
	int a,qm,bj,lw;
	bool xb,xsh;
	string mz;
int hehe(){
	int hehe;
	hehe=0;
	if(xb==true)hehe+=1000;
	if(xsh==true)hehe+=850;
	if(qm>90)hehe+=2000;
	if(qm>=80&&lw>=1)hehe+=8000;
	if(qm>=85&&bj>=80)hehe+=4000;
	return hehe;
}
int main() {
	int max,tot;
	string hsz;
	max=0;
	tot=0;
	cin>>a;
	for(int i=1;i<=a;i++){
		cin>>mz>>qm>>bj;
		char x,y;
		cin>>x>>y;
		xsh=false;
		xb=false;
		if(x=='Y')xsh=true;
		if(y=='Y')xb=true;
		cin>>lw;
		int a=hehe();
		if(a>max){
		max=a;
		hsz=mz;	
		}
		tot+=a;
	}
	cout<<hsz<<endl<<max<<endl<<tot;
	return 0;
}

回复

4 条回复,欢迎继续交流。

正在加载回复...