这个程序输入数据后运行为什吗结果不对?求解释。
[code#include<stdio.h>struct student
{
int num;
char name[10];
float Mscore;
float Iscore;
float sum;
float aver;
};
void main()
{
struct student a[5],k;
int i,j;
printf("请输入每个同学的信息:\n");
for(i=0;i<5;i++)
{
scanf("%d,%s,%f,%f",&a[i].num,a[i].name,&a[i].Mscore,&a[i].Iscore);
a[i].sum=a[i].Mscore+a[i].Iscore;
a[i].aver=a[i].sum/2;
}
for(i=0;i<4;i++)
{
for(j=1;j<=4-i;j++)
if(a[i].sum<a[j].sum){k=a[i];a[i]=a[j];a[j]=k;}
}
for(i=0;i<4;i++)
printf("%d %3c %5.2f %5.2f %5.2f %5.2f\n ",a[i].num,a[i].name,a[i].Mscore,a[i].Iscore,a[i].sum,a[i].aver);
}][/code]