forked from pn8rjlxip/System
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
421 B
18 lines
421 B
2 years ago
|
void AverSumofEveryCourse(STU stu[], int n, int m)
|
||
|
{
|
||
|
int i, j;
|
||
|
float sum[COURSE_NUM], aver[COURSE_NUM];
|
||
|
/* ---------- begain ---------- */
|
||
|
for (j=0; j<m; j++)
|
||
|
{
|
||
|
sum[j] = 0;
|
||
|
for (i=0; i<n; i++)
|
||
|
{
|
||
|
sum[j] += stu[i].score[j];
|
||
|
}
|
||
|
aver[j]=sum[j]/i;
|
||
|
printf("student %d: sum = %.0f, aver = %.0f\n",
|
||
|
j+1, sum[j], aver[j]);
|
||
|
}
|
||
|
/* ----------- end ----------- */
|
||
|
}
|