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 1/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 2/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 Date: Sun, 23 Apr 2023 20:05:54 +0800 Subject: [PATCH 3/3] df --- void | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/void b/void index 51cb4ec..4c05a94 100644 --- a/void +++ b/void @@ -1,16 +1,14 @@ -// 函数功能:计算每个学生各门课程的总分和平均分 -void AverSumofEveryStudent(STU stu[], int n, int m) +// 函数功能:输入n个学生的m门课成绩 +void ReadScore(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); - } -} + int i, j; + printf("Input student's ID, name and score:\n"); + /* ---------- begain ---------- */ + for(i=0;i