@ -187,7 +187,17 @@ void ReadScore(STU stu[],int n,int m)
```
void AverSumofEveryStudent(STU stu[],int n,int m)
{
int i,j;
for(i=0;i<n;i++)
stu[i].sum = 0; //初始化每个学生总分为0
for(j=0;j<m;j++)
stu[i].sum = stu[i].sum + stu[i].score[j]; //累加分数
}
stu[i].aver = m>0 ? stu[i].sum /m : -1;
printf("student %d: sum = %.0f,aver = %.0f\n",i+1,stu[i].sum,stu[i].aver);