作者在 2009-03-08 17:47:27 发布以下内容
#include "stdio.h"
main()
{
type struct Student{
char name[20];
float qmcj;
float bjcj;
char xsgb;
char xbxs;
float lw;
float money;
}
int n,i;
float maxmoney,max;
char *maxname;
max=0;
maxmoney=0;
scanf("%d"\n,&n);
Student st[n];
for(i=0;i<n;i++)
{
scanf("%c %f %f %c %c %f ",&st[i].name,&st[i].qmcj,&st[i].bjbj,&st[i].xbxs,&st[i].zb,&st[i].lw);
if(qmcj>80&&lw>=1)
{
st[i].money=st[i].money+8000;
}
if(qmcj>80&&bjcj>80)
{
st[i].money=st[i].money+4000;
}
if(qmcj>90)
{
st[i].money=st[i].mone+2000;
}
if(xbsx==Y&&qmcj>85)
{
st[i].money=st[i].money+1000;
}
if(xsgb==Y)
{
st[i].money=st[i].money+850;
}
if(max<st[i].money)
{
max=st[i].money;
maxname=&st[i].name;
}
maxmoney=maxmoney+st[i].money;
}
printf("%c"/n,maxname);
printf("%f"/n,max);
printf("%f"/n,maxmoney);
}
main()
{
type struct Student{
char name[20];
float qmcj;
float bjcj;
char xsgb;
char xbxs;
float lw;
float money;
}
int n,i;
float maxmoney,max;
char *maxname;
max=0;
maxmoney=0;
scanf("%d"\n,&n);
Student st[n];
for(i=0;i<n;i++)
{
scanf("%c %f %f %c %c %f ",&st[i].name,&st[i].qmcj,&st[i].bjbj,&st[i].xbxs,&st[i].zb,&st[i].lw);
if(qmcj>80&&lw>=1)
{
st[i].money=st[i].money+8000;
}
if(qmcj>80&&bjcj>80)
{
st[i].money=st[i].money+4000;
}
if(qmcj>90)
{
st[i].money=st[i].mone+2000;
}
if(xbsx==Y&&qmcj>85)
{
st[i].money=st[i].money+1000;
}
if(xsgb==Y)
{
st[i].money=st[i].money+850;
}
if(max<st[i].money)
{
max=st[i].money;
maxname=&st[i].name;
}
maxmoney=maxmoney+st[i].money;
}
printf("%c"/n,maxname);
printf("%f"/n,max);
printf("%f"/n,maxmoney);
}
\\
#include "stdio.h"
main()
{
typedef struct
{
char name[20];
float qmcj;
float bjcj;
char xsgb;
char xbxs;
float lw;
float money;
}Student;
int n=4,i;
float maxmoney,max;
char *maxname;
Student st[100];
max=0;
maxmoney=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%s %f %f %c %c %f",st[i].name,&st[i].qmcj,&st[i].bjcj,&st[i].xsgb,&st[i].xbxs,&st[i].lw);
getchar();
st[i].money=0;
if(st[i].qmcj>80 && st[i].lw>=1)
{
st[i].money=8000;
}
if(st[i].qmcj>85 && st[i].bjcj>80)
{
st[i].money=st[i].money+4000;
}
if(st[i].qmcj>90)
{
st[i].money=st[i].money+2000;
}
if(st[i].xbxs=='Y' && st[i].qmcj>85)
{
st[i].money=st[i].money+1000;
}
if(st[i].xsgb=='Y')
{
st[i].money=st[i].money+850;
}
if(max<st[i].money)
{
max=st[i].money;
maxname=st[i].name;
}
maxmoney=maxmoney+st[i].money;
}
printf("%s\n",maxname);
printf("%.0f\n",max);
printf("%.0f\n",maxmoney);
}
main()
{
typedef struct
{
char name[20];
float qmcj;
float bjcj;
char xsgb;
char xbxs;
float lw;
float money;
}Student;
int n=4,i;
float maxmoney,max;
char *maxname;
Student st[100];
max=0;
maxmoney=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%s %f %f %c %c %f",st[i].name,&st[i].qmcj,&st[i].bjcj,&st[i].xsgb,&st[i].xbxs,&st[i].lw);
getchar();
st[i].money=0;
if(st[i].qmcj>80 && st[i].lw>=1)
{
st[i].money=8000;
}
if(st[i].qmcj>85 && st[i].bjcj>80)
{
st[i].money=st[i].money+4000;
}
if(st[i].qmcj>90)
{
st[i].money=st[i].money+2000;
}
if(st[i].xbxs=='Y' && st[i].qmcj>85)
{
st[i].money=st[i].money+1000;
}
if(st[i].xsgb=='Y')
{
st[i].money=st[i].money+850;
}
if(max<st[i].money)
{
max=st[i].money;
maxname=st[i].name;
}
maxmoney=maxmoney+st[i].money;
}
printf("%s\n",maxname);
printf("%.0f\n",max);
printf("%.0f\n",maxmoney);
}