题目:某班期末考试科目为数学(MT)、英语(EN)和物理(PH),有最多不超过40人参加考试,请编程计算:(1).每个学生的平均分(2).每门课程的总分和平均分
代码如下:
#include<stdio.h>
#define STUD_N 40
#define COURSE_N 3
void ReadScore(int score[][COURSE_N], long nume[], int n);
void AverforStud(int score[][COURSE_N], int sum[], float aver[], int n);
void AverforCourse(int score[][COURSE_N], int sum[], float aver[], int n);
void print(int score[][COURSE_N], int sum[], int sumS[], float avers[], int sumC[], float averC[], int n);
int main(void)
{
int score[STUD_N][COURSE_N], sumS[STUD_N], sumC[COURSE_N], n;
long num[STUD_N];
float averS[STUD_N], averC[COURSE_N];
printf("input the total number of the students(n<=40):");
scanf("%d", &n);
ReadScore(score, num, n);
AverforStud(score, sumS, averS, n);
AverforCourse(score, sumC, averC, n);
print(score, num, sumS, averS, sumC, averC, n);
return 0;
}
//函数功能:输入n个学生的学号以及其三门课成绩
void ReadScore(int score[][COURSE_N]