- 谁拿了最多奖学金
- 2015-07-26 21:27:23 @
// 谁拿了最多奖学金.cpp : 定义控制台应用程序的入口点。
#include <iostream>
#include <string>
using namespace std;
class student
{
public:
string name;
int qc;
int bp;
char gb;
char xb;
int lws;
int jjs;
void make()
{
jjs=0;
if((qc>80)&&(lws>0))jjs=jjs+8000;
if((qc>85)&&(bp>80))jjs=jjs+4000;
if(qc>90)jjs=jjs+2000;
if((qc>85)&&(xb=='Y'))jjs=jjs+1000;
if((bp>80)&&(gb=='Y'))jjs=jjs+850;
}
};
int main()
{
int zs=0;
int bh=0;
int zds=0;
int n;
cin>>n;
student sj[101];
for(int i=1;i<=n;i++)
{
cin>>sj[i].name;
cin>>sj[i].qc;
cin>>sj[i].bp;
cin>>sj[i].gb;
cin>>sj[i].xb;
cin>>sj[i].lws;
sj[i].make();
zs=zs+sj[i].jjs;
if(sj[i].jjs>zds)
{
bh=i;
zds=sj[i].jjs;
}
}
cout<<sj[bh].name<<endl;
cout<<sj[bh].jjs<<endl;
cout<<zs;
cin>>n;
return 0;
}//by pengyao1207