欢迎来到天天文库
浏览记录
ID:55666398
大小:28.50 KB
页数:8页
时间:2020-05-23
《C语言写的学生成绩管理系统(链表).doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、#include#include#includestructstud{longnum;charname[20];floatsx;floatdx;floatts;floatdl;floatcx;floatzf;floatpj;};structstudcode{structstudstudent;structstudcode*next;};voidmenu();voidinput(structstudcode**);voidoutput(structstudcode*);voidbinsearch(structstudcode*);voi
2、dinsert(structstudcode**);voiddelet(structstudcode**);voidgood(structstudcode*);voidfail(structstudcode*);voidsort(structstudcode*);voidback();voidmain(){charchoose;intflag=1;structstudcode*head;head=NULL;printf("请先录入学生成绩信息");printf("输入学生学号姓名高数、英语读写、英语听说、计算机导论和程序设计的成绩");input(&head);while(flag)
3、{system("cls");menu();printf("请选择:");getchar();choose=getchar();switch(choose){case'1':output(head);back();break;case'2':binsearch(head);back();break;case'3':insert(&head);output(head);back();break;case'4':delet(&head);output(head);back();break;case'5':good(head);back();break;case'6':fail(head);bac
4、k();break;case'7':sort(head);output(head);back();break;case'0':flag=0;printf("***TheEnd!***");printf("####感谢使用,欢迎再次登录,拜拜!####");break;default:printf("WrongSelection!(选择错误,请重选)");back();}}}voidmenu(){printf("学生成绩统计与分析系统");printf("菜单");printf("1.显示所有学生的信息");printf("2.查找某学号
5、的学生信息");printf("3.插入某学生的信息");printf("4.删除某学号学生的信息");printf("5.统计各门课程成绩在90分以上学生所占百分比");printf("6.统计各门课程成绩在60分以下学生所占百分比");printf("7.按总分降序排序,依高低排出名次");printf("0.退出");}voidback(){intx;printf("");do{printf("按1返回菜单界面:");scanf("%d",&x);}while(x!=1);}voidinput(structstudcode**
6、headp){structstudcode*p;while(1){p=(structstudcode*)malloc(sizeof(structstudcode));scanf("%ld",&p->student.num);if(p->student.num==0)break;scanf("%s%f%f%f%f%f",&p->student.name,&p->student.sx,&p->student.dx,&p->student.ts,&p->student.dl,&p->student.cx);p->student.zf=p->student.sx+p->student.dx+p->s
7、tudent.ts+p->student.dl+p->student.cx;p->student.pj=p->student.zf/5;p->next=*headp;*headp=p;}}voidoutput(structstudcode*head){structstudcode*p;p=head;printf("学号t姓名t高数t读写t听说t导论t程序t总分t平均分");while(p!
此文档下载收益归作者所有