[求助]C碰到的一个小问题
struct stu{
int num;
char *name;
char sex;
float score;
}boy[5]={
{101,"Li ping",'M',45},
{102,"Zhang ping",'M',62.5},
{103,"He fang",'F',92.5},
{104,"Cheng ling",'F',87},
{105,"Wang ming",'M',58},
};
main()
{
int i,c=0;
float ave,s=0;
for(i=0;i<5;i++)
{
s+=boy[i].score;
if(boy[i].score<60) c+=1;
}
printf("s=%f\n",s);
ave=s/5;
printf("average=%f\ncount=%d\n",ave,c);
}
编译完TC20提示编译错误:Declaration syntax error (说明出现语法错误)
但是本人却找不到错在哪
帮帮我 ‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’大虾们