- 谁拿了最多奖学金
- 2009-07-14 16:14:07 @
会的帮我改下~
#include
struct student
{
char name[20];
int score1;
int score2;
char a;
char b;
int num;
};
int main(void)
{ struct student stu[100];
int i,n,s[100]={0},max,p,k=0;
scanf("%d",&n);
for(i=0;i80) s[i]=s[i]+8000;
if(stu[i].score1>85&&stu[i].score2>80) s[i]=s[i]+4000;
if(stu[i].score1>90) s[i]=s[i]+2000;
if(stu[i].score1>85&&stu[i].b=='Y') s[i]=s[i]+1000;
if(stu[i].score2>80&&stu[i].a=='Y') s[i]=s[i]+850;
}
max=s[0];
for(i=0;imax)
{max=s[i];
p=i;
}
}
printf("%s\n",stu[p].name);
printf("%d\n",max);
for(i=0;i
0 条评论
目前还没有评论...