1、/成绩管理系统 v2.0#include #include #define N 30void Input (long num,int score,int n);void Totalave (int score,int n);void Scoredes (long num,int score,int n,int (*compare)(int a,int b);int Ascending (int a,int b);void Numas (long num,int score,int n);void Search (long num,int score,int n,int x);void stat
2、istis (long num,int score,int n);void List (long num,int score,int n);int main()int n,scoreN,c,x,i;long numN;printf(“输入学生人数“);scanf(“%d“,printf(“1.Input recordn“);printf(“2.Caculate totel and average score of coursen“);printf(“3.Sort in descending order by scoren“);printf(“4.Sort in ascending order
3、by numbern“);printf(“5.Search by numbern“);printf(“6.Statistic analysisn“);printf(“7.List recordn“);printf(“0.Exitn“);printf(“Please enter your choice:n“);printf(“n“);for(;)scanf(“%d“,switch(c)case 1:Input (num,score,n);printf(“Please enter your choice:n“);break;case 2:Totalave (score,n);printf(“Ple
4、ase enter your choice:n“);break;case 3:Scoredes (num,score,n,Ascending);for(i=0;inummid)low=mid+1;else if(xscorepos)c+;printf(“ID:%10ld,order:%d,score:%dn“,numpos,c+1,scorepos);void statistis (long num,int score,int n)int a=0,b=0,c=0,d=0,e=0,i;double A,B,C,D,E;for(i=0;i=90)a+;else if(scorei=80)b+;el
5、se if(scorei=70)c+;else if(scorei=60)d+;elsee+;A=(double)a/n*100;B=(double)b/n*100;C=(double)c/n*100;D=(double)d/n*100;E=(double)e/n*100;printf(“优秀人数%d,百分比:%f%n“,a,A);printf(“良好人数%d,百分比:%f%n“,b,B);printf(“中等人数%d,百分比:%f%n“,c,C);printf(“及格人数%d,百分比:%f%n“,d,D);printf(“不及格人数%d,百分比:%f%n“,e,E);void List (long num,int score,int n)int i;for(i=0;in;i+)printf(“ID:%10ld,score:%dn“,numi,scorei);