高手帮忙看看哪错了
第二次循环就输入不了name (红色部分)!!谢谢指导!1=========================================================================================================================================
#include <stdio.h>
#include <string.h>
struct zl
{long num;
char name[20];
float c,e,m;
};
main ()
{
struct zl p[3];
int i;
float z=0,pj,max,s[3];
for (i=0;i<3;i++)
{
printf ("xue sheng %d\n",i+1);
printf ("name\n");
gets (p[i].name);
printf ("No.,Chinese,English,Match\n");
scanf ("%ld,%f,%f,%f",&p[i].num,&p[i].c,&p[i].e,&p[i].m);
s[i]=p[i].c+p[i].e+p[i].m;
z=z+s[i];
}
printf ("ping jun fen:%f\n",z/3);
max=s[0];
for (i=1;i<3;i++);
{
if (max<s[i])
max=s[i];
}
for (i=0;i<3;i++)
{
if (max==s[i])
{
pj=s[i]/3;
printf ("name:");
puts (p[i].name);
printf ("\nNo.:%ld\nChinese:%f\nEnglish:%f\nMatch:%f\nping jun fen:%f\n",p[i].num,p[i].c,p[i].e,p[i].m,pj);
}
}
getche ();
}
[ 本帖最后由 itmen 于 2010-6-26 15:48 编辑 ]