- 谁拿了最多奖学金
- 2017-09-13 21:53:05 @
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
int n,qm,bj,lw,temp1=0,sum=0,i;
char xg,xb;
string temp2;
int jxj[200];
memset(jxj,0,sizeof(jxj));
cin>>n;
string name[200];
for(i=1;i<=n;++i)
{
cin>>name[i]>>qm>>bj>>xg>>xb>>lw;
if((qm>80)&&(lw!=0))
jxj[i]+=8000;
if((qm>85)&&(bj>80))
jxj[i]+=4000;
if(qm>90)
jxj[i]+=2000;
if((qm>85)&&(xb=='Y'))
jxj[i]+=1000;
if((bj>80)&&(xg=='Y'))
jxj[i]+=850;
sum+=jxj[i];
}
for(i=1;i<=n;++i)
{
if(jxj[i]<jxj[i+1])
{
temp2=name[i];
name[i]=name[i+1];
name[i+1]=temp2;
temp1=jxj[i];
jxj[i]=jxj[i+1];
jxj[i+1]=temp1;
}
}
cout<<name[1]<<endl<<jxj[1]<<endl<<sum<<endl;
return 0;
}
2 条评论
-
Galileonardo LV 7 @ 2017-10-04 21:42:48
#include <iostream>
using namespace std;int n,number;
string name,ans1;
int a,b,e;
char c,d;
int ans2=0;
int ans3=0;int main(){
cin>>n;
for(int i=1;i<=n;i++){
number=0;
cin>>name;
cin>>a>>b;
c=getchar();
c=getchar();
d=getchar();
d=getchar();
cin>>e;
if((a>80)&&(e!=0)){
number+=8000;
}
if((a>85)&&(b>80)){
number+=4000;
}
if(a>90){
number+=2000;
}
if((a>85)&&(d=='Y')){
number+=1000;
}
if((b>80)&&(c=='Y')){
number+=850;
}
if(number>ans2){
ans1=name;
ans2=number;
}
ans3+=number;
}
cout<<ans1<<endl;
cout<<ans2<<endl;
cout<<ans3;
return 0;
} -
2017-10-03 09:03:09@
我也是零分,好巧。。。
- 1