From b20170da3a33e1a9171ea1f3958604ebe82067b2 Mon Sep 17 00:00:00 2001 From: tong tong zhang Date: Sun, 21 May 2023 16:37:27 +0800 Subject: [PATCH] 8 --- src | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/src b/src index a2e2870..ca8d099 100644 --- a/src +++ b/src @@ -107,3 +107,71 @@ int Menu(void) scanf("%d", &itemSelected); // 读入用户输入 return itemSelected; } +//1 函数功能:输入n个学生的m门课成绩 +void ReadScore(STU stu[], int n, int m) +{ + int i, j; + printf("Input student's ID, name and score:\n"); + for(i=0;i0 ? stu[i].sum / m : -1; + printf("student %d: sum = %.0f, aver = %.0f\n", +i+1, stu[i].sum, stu[i].aver); + } +} +//3 函数功能:计算每门课程的总分和平均分 +void AverSumofEveryCourse(STU stu[], int n, int m) +{ + int i, j; + float sum[COURSE_NUM], aver[COURSE_NUM]; + for (j=0; j