C语言结构体题目,我哪里错了
/* Note:Your choice is C IDE */#include "stdio.h"
int math();
struct student
{
char name[10];
int num;
int score[3];
}s[10];
int math()
{
int k[10],i,*p=k,*q,b;
for(i=0;i<10;i++)
{
k[i]=(s[i].score[0]+s[i].score[1]+s[i].score[2])/3;
if(k[i]>*p)
{p=&k[i];q=&i;}
}
b=(k[0]+k[1]+k[2]+k[3]+k[4]+k[5]+k[6]+k[7]+k[8]+k[9])/10;
printf("三门课总平均分:%d",b);
printf("最高分学生信息:%s %d %d %d",s[*q].name,s[*q].num,s[*q].score[0],s[*q].score[1],s[*q].score[2]);
return 0;
}
void main()
{
int i;
for(i=0;i<10;i++)
scanf("%s,%d,%d,%d,%d",s[i].name,&s[i].num,&s[i].score[0],&s[i].score[1],&s[i].score[2]);
math();
getch();
}