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 diff --git a/void b/void new file mode 100644 index 0000000..51cb4ec --- /dev/null +++ b/void @@ -0,0 +1,16 @@ +// 函数功能:计算每个学生各门课程的总分和平均分 +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); + } +}