- 谁拿了最多奖学金
- 2009-01-16 20:58:23 @
#include
#include
#define NUM1 100
#define NUM2 21
using namespace std;
struct
{
char name[NUM2];
int grade;
int clagrade;
char ganbu;
char west;
int paper;
}stu[NUM1];
main()
{
int many,money[NUM1],temp,who,add=0;
for(int i=0;i>many;
for(int i=0;i>stu[i].name;
cin>>stu[i].grade;
cin>>stu[i].clagrade;
cin>>stu[i].ganbu;
cin>>stu[i].west;
cin>>stu[i].paper;
}
for(int i=0;i80&&stu[i].paper>=1)
{
money[i]+=8000;
}
if(stu[i].grade>85&&stu[i].clagrade>80)
{
money[i]+=4000;
}
if(stu[i].grade>90)
{
money[i]+=2000;
}
if(stu[i].grade>85&&stu[i].west=='Y')
{
money[i]+=1000;
}
if(stu[i].clagrade>80&&stu[i].ganbu=='Y')
{
money[i]+=850;
}
}
for(int i=0;imoney[who]) who=i;
if(i!=x&&money[i]
0 条评论
目前还没有评论...