扯谈
马上就要一百粉了,九十九粉,最后一粉就靠你们了!
题目
思路
爆搜挂着机,打表出省一!
代码
#include<iostream>
using namespace std;
signed main() {
int n,score1,score2,sum=0,max=0,total=0,x,i;
char a,b;
string name,maxn;
cin>>n;
for(i=1; i<=n; i++) {
cin>>name>>score1>>score2>>a>>b>>x;
if(score1>80&&x>0) { //ÅжÏÊÇ·ñ»ñµÃԺʿ½±Ñ§½ð
sum+=8000;
}
if(score1>85&&score2>80) { //ÅжÏÊÇ·ñ»ñµÃÎåËĽ±Ñ§½ð
sum+=4000;
}
if(score1>90) { //ÅжÏÊÇ·ñ»ñµÃ³É¼¨ÓÅÐã½±
sum+=2000;
}
if(score1>85&&b=='Y') { //ÅжÏÊÇ·ñ»ñµÃÎ÷²¿½±Ñ§½ð
sum+=1000;
}
if(score2>80&&a=='Y') { //ÅжÏÊÇ·ñ»ñµÃ°à¼¶¹±Ï×½±
sum+=850;
}
total+=sum;//ÀÛ¼Ó½±Ñ§½ð
if(sum>max) { //ÕÒ³ö×îţѧÉú
maxn=name;
max=sum;//sumµÄÓô¦
}
sum=0;
}
cout<<maxn<<endl<<max<<endl<<total;
return 0;
}
结语
快点赞加关注吧!