- 谁拿了最多奖学金
- 2010-03-04 19:29:59 @
#include
#include
using namespace std;
class student
{public:
string stuname;
long int stumark;
long int stucmark;
char stugb;
char stuxb;
long int stutext;
long int stuaward;
void Setdata(string name,long int mark=0,long int cmark=0,char gb='N',char xb='N',long int text=0,long int award=0)
{stuname=name;stumark=mark;stucmark=cmark;stugb=gb;stuxb=xb;stutext=text;stuaward=award;}
};
int main(int argc, char *argv[])
{ long int stunum=0;
string stuname;
long int stumark=0;
long int stucmark=0;
char stugb;
char stuxb;
long int stutext=0;
long int stuaward=0;
long int stuall=0;
long int hnum=0;
do
{cin>>stunum;
}
while(stunum100);
student *pstudent=new student[stunum];
long int stupriceh=0;
string highpricestu[100];
for(int i=0;i>stuname>>stumark>>stucmark>>stugb>>stuxb>>stutext;
pstudent[i].Setdata(stuname,stumark,stucmark,stugb,stuxb,stutext);
}
for(int y=0;y80 && pstudent[y].stutext>=1)
{pstudent[y].stuaward+=8000;}
if(pstudent[y].stumark>85 && pstudent[y].stucmark>80)
{pstudent[y].stuaward+=4000;}
if(pstudent[y].stumark>90)
{pstudent[y].stuaward+=2000;}
if(pstudent[y].stumark>85 && pstudent[y].stuxb=='Y')
{pstudent[y].stuaward+=1000;}
if(pstudent[y].stumark>80 && pstudent[y].stugb=='Y')
{pstudent[y].stuaward+=850;}
stuall+=pstudent[y].stuaward;
if (stupriceh