diff --git a/README.md b/README.md index 06c70dc..e385ec3 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,25 @@ int main(void) ``` 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("3.Calculate total and average score of evry student\n"); + printf("4.Sort in descending order by score\n"); + printf("5.Sort in ascending order by score\n"); + printf("6.Sort in ascending order by number\n"); + printf("7.Sort in dictionary order by name\n"); + printf("8.Search by number\n"); + printf("9.Search by name\n"); + printf("10.Statistic analysis\n"); + printf("11.List record\n"); + printf("12.Write to a file\n"); + printf("13.Read from a file\n"); + printf("0.Exit\n"); + printf("Please Input your choice:"); + scanf("%d",&itemSelected); //读入用户输入 + return itemSelected; } ``` @@ -169,7 +187,17 @@ void ReadScore(STU stu[],int n,int m) ``` 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); + } } ``` @@ -177,7 +205,21 @@ void AverSumofEveryStudent(STU stu[],int n,int m) ``` void AverSumofEveryCourse(STU stu[],int n,int m) { + int i,j; + float sum[COURSE_NUM],aver[COURSE_NUM]; + /*--------------begin------------*/ + for(j=0;j