资源描述:
《学生成绩管理系统v60》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实用文档#include#include#include#definem_l10#definem_num30#definem_cs6typedefstructstudent{longnum;charname[m_l];floatscore[m_cs];floatsum;floataver;}STU;intmenu(void);voidReadscore(STUstu[],intn,intm);voidAversumofeverystudent(STUstu
2、[],intn,intm);voidAversumofeverycourse(STUstu[],intn,intm);文案大全实用文档voidSortbyscore(STUstu[],intn,intm,int(*compare)(floata,floatb));intAscending(floata,floatb);intDescending(floata,floatb);voidswapfloat(float*x,float*y);voidswaplong(long*x,long*y);voidswapcha
3、r(charx[],chary[]);voidAssortbynum(STUstu[],intn,intm);voidSortbyname(STUstu[],intn,intm);voidSearchbynum(STUstu[],intn,intm);voidSearchbyname(STUstu[],intn,intm);voidStatisticAnlysis(STUstu[],intn,intm);voidPrintscore(STUstu[],intn,intm);voidWritetofile(STUs
4、tu[],intn,intm);voidReadfromfile(STUstu[],int*n,int*m);intmain(){charch;intn=0,m=0;文案大全实用文档STUstu[m_num];printf("请输入学生人数(n<=%d):",m_num);scanf("%d",&n);printf("请输入课程数目(m<=%d):",m_cs);scanf("%d",&m);while(1){ch=menu();switch(ch){case1:Readscore(stu,n,m);br
5、eak;case2:Aversumofeverystudent(stu,n,m);break;case3:Aversumofeverycourse(stu,n,m);文案大全实用文档break;case4:Sortbyscore(stu,n,m,Descending);printf("成绩降序排序");Printscore(stu,n,m);break;case5:Sortbyscore(stu,n,m,Ascending);printf("成绩升序排序");Printscore(stu,n,m)
6、;break;case6:Assortbynum(stu,n,m);printf("学号升序排序");Printscore(stu,n,m);break;case7:Sortbyname(stu,n,m);文案大全实用文档printf("姓名字典升序排序");Printscore(stu,n,m);break;case8:Searchbynum(stu,n,m);break;case9:Searchbyname(stu,n,m);break;case10:StatisticAnlysis(stu,
7、n,m);break;case11:Printscore(stu,n,m);break;case12:Writetofile(stu,n,m);break;文案大全实用文档case13:Readfromfile(stu,&n,&m);break;case0:printf("欢迎下次继续使用");exit(0);default:printf("输入错误");}}return0;}intmenu(void){intitems;printf("欢迎使用学生成绩管理系统");printf("1.输入成绩"
8、);文案大全实用文档printf("2.计算各个学生总成绩和平均成绩");printf("3.计算各门学科总成绩和平均成绩");printf("4.成绩降序排序");printf("5.成绩升序排序");printf("6.学号升序排序");printf("7.姓名升序排序");printf("8.通过学号查找成绩");printf("9.通过