为什么再次输入时不能正确输入信息了?(TC下)
#includ<stdio.h>struct stud{
int xuehao;
char name[10];
float shuxue,yuwen,c;
} abc;
main()
{ int i,n;
float j;
printf("shururenshu:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("shuru:%d.xuehao\txingming\n",i);
scanf("%d",&abc.xuehao);
scanf("%s",&abc.name);
printf("shuxue\tyingyu\tc\t\n");
scanf("%f%f%f\n",&abc.shuxue,&abc.yuwen,&abc.c);
printf("%d.xuehao:%d",i,abc.xuehao);
printf("\nxingming:%s",abc.name);j=ave(abc);
printf("\nave=%f\n",j);
}
getch();
}
int ave(struct stud fa)
{ return fa.shuxue/3+fa.yuwen/3+fa.c/3;
}