From 186e8cb2e2fe794bf77bb536da9b5a2c2a32fb7a Mon Sep 17 00:00:00 2001 From: Liwenfei <3496841962@qq.com> Date: Wed, 19 Apr 2023 12:44:01 +0800 Subject: [PATCH 1/3] menu --- menu | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 menu diff --git a/menu b/menu new file mode 100644 index 0000000..eeb5ec0 --- /dev/null +++ b/menu @@ -0,0 +1,11 @@ +int Menu(void) +{ + int itemSelected; + printf("Management for Students' scores\n"); + printf("1.Input record\n"); + printf("2.Calculate total and average score of every course\n"); + printf("0.Exit\n"); + printf("Please Input your choice:"); + scanf("%d", &itemSelected); // 读入用户输入 + return itemSelected; +} \ No newline at end of file From 63d3b5e77be2b8d577ca644fc70a398a4e5444b3 Mon Sep 17 00:00:00 2001 From: wuhangkai <2048572486@qq.com> Date: Sat, 22 Apr 2023 14:13:14 +0800 Subject: [PATCH 2/3] void --- void | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 void diff --git a/void b/void new file mode 100644 index 0000000..698cad6 --- /dev/null +++ b/void @@ -0,0 +1,33 @@ +// 函数功能:计算每个学生各门课程的总分和平均分 +void AverSumofEveryStudent(STU stu[], int n, int m) +{ + int i, j; + 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); + } +} +// 函数功能:计算每门课程的总分和平均分 +void AverSumofEveryCourse(STU stu[], int n, int m) +{ + int i, j; + float sum[COURSE_NUM], aver[COURSE_NUM]; + /* ---------- begain ---------- */ + for (j=0; j Date: Sun, 23 Apr 2023 11:54:50 +0800 Subject: [PATCH 3/3] void --- void | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/void b/void index 698cad6..51cb4ec 100644 --- a/void +++ b/void @@ -14,20 +14,3 @@ void AverSumofEveryStudent(STU stu[], int n, int m) i+1, stu[i].sum, stu[i].aver); } } -// 函数功能:计算每门课程的总分和平均分 -void AverSumofEveryCourse(STU stu[], int n, int m) -{ - int i, j; - float sum[COURSE_NUM], aver[COURSE_NUM]; - /* ---------- begain ---------- */ - for (j=0; j