C语言写的学生成绩管理系统

上传人:pu****.1 文档编号:487314496 上传时间:2023-01-29 格式:DOC 页数:7 大小:61.50KB
返回 下载 相关 举报
C语言写的学生成绩管理系统_第1页
第1页 / 共7页
C语言写的学生成绩管理系统_第2页
第2页 / 共7页
C语言写的学生成绩管理系统_第3页
第3页 / 共7页
C语言写的学生成绩管理系统_第4页
第4页 / 共7页
C语言写的学生成绩管理系统_第5页
第5页 / 共7页
点击查看更多>>
资源描述

《C语言写的学生成绩管理系统》由会员分享,可在线阅读,更多相关《C语言写的学生成绩管理系统(7页珍藏版)》请在金锄头文库上搜索。

1、#in clude#in clude#in cludestruct studlong num;char n ame20;float sx;float dx;float ts;float dl;float cx;float zf;float pj;struct studcodestruct stud stude nt;struct studcode *n ext;void menu();void in put(struct studcode *);void output(struct studcode *);void bin search(struct studcode *);void in s

2、ert(struct studcode *);void delet(struct studcode *);void good(struct studcode *);void fail(struct studcode *);void sort(struct studcode *);void back();void mai n()char choose;int flag=1;struct studcode *head;head=NULL;printf(请先录入学生成绩信息n);printf(输入学生学号姓名高数、英语读写、英语听说、计算机导论和程序设计的成绩n);in put (&head);wh

3、ile (flag)system(cls);menu();printf(请选择:”);getchar();choose=getchar();switch(choose)case 1:output(head);back();break;case 2:bin search(head);back();break;case 3:in sert (&head);output(head);back();break;case 4:delet(& head);output(head);back();break;case 5:good(head);back();break;case 6:fail(head);b

4、ack();break;case 7:sort(head);output(head);back();break;case O:flag=0;prin tf(n* The End! *n);# n);printf(n #感谢使用,欢迎再次登录,拜拜!break;default: printf(n Wrong Selection !(选择错误,请重选 )n); back(); void menu()printf(” n学生成绩统计与分析系统n);printf(” n菜 单 nn);printf(” n1.显示所有学生的信息n);printf(” n2.查找某学号的学生信息n);printf(” n

5、3.插入某学生的信息n);printf(” n4.删除某学号学生的信息n);printf(” n5.统计各门课程成绩在 90分以上学生所占百分比printf(” n6.统计各门课程成绩在 60分以下学生所占百分比printf(” n7.按总分降序排序,依高低排出名次n);printf(” n0.退出 nn);n ”);n);void back()int兀prin tf(n);doprintf(”按1返回菜单界面:”); scan f(%d,& x);while(x!=1);void in put(struct studcode *headp)struct studcode *p;while(1

6、)p=(struct studcode *)malloc(sizeof(struct studcode); scan f(%ld,&p-stude nt. nu m);if(p-stude nt. num=0) break;scan f(%s%f%f%f%f%f,&p-stude nt.n ame,&p-stude nt.sx,&p-stude nt.dx,&p-stude nt.ts, &p-stude nt.dl,&p-stude nt.cx);p-stude nt.zf=p-stude nt.sx+p-stude nt.dx+p-stude nt.ts+p-stude nt.dl+p-s

7、tude nt.cx; p-stude nt.pj=p-stude nt.zf/5;p-n ext=*headp;*headp=p;void output(struct studcode *head)struct studcode *p;p=head;printf(学号t姓名t高数t读写t听说t导论t程序t总分t平均分n”); while(p!=NULL)prin tf(%-ldt%-4st%-0.2ft%-0.2ft%-0.2ft%-0.2ft%-0.2ft%-0.2ft%-0.2fn ”,p-stude nt.n um,p-stude nt.n ame,p-stude nt.sx,p-st

8、ude nt.dx,p-stude nt.ts,p-stude nt.dl,p-stude nt.cx,p-s tude nt.zf,p-stude nt.pj);p=p-n ext;prin tf(n);void bin search(struct studcode *head)struct studcode *p;int k=1;long x;p=head;printf(请输入需要查找的学生的学号:);scan f(%ld, &x);prin tf(n);while(p!=NULL)if(p-stude nt. num=x)printf(该学生信息如下:n);printf(学号t姓名t高数

9、t读写t听说t导论t程序t总分t平均分n);prin tf(%-ldt%-4st%-0.2ft%-0.2ft%-0.2ft%-0.2ft%-0.2ft%-0.2ft%-0.2fn,p-stude nt.n um,piFFF-r-F-FFF一扌彳-F-FFF-i -F.-F- XFFF*FFXF* -stude nt. name,p-stude nt.sx,p-stude nt.dx,p-stude nt.ts,p-stude nt.dl,p-stude nt.cx,p-stude n t.zf,p-stude nt.pj);k=0;break;p=p-n ext;if(k) printf(没有

10、此学生的信息n); void in sert(struct studcode *headp)struct studcode *p;p=(struct studcode *)malloc(sizeof (struct studcode);printf(”请输入你想插入的学生的信息n);scan f(%ld%s%f%f%f%f%f,&p-stude nt.n um,&p-stude nt.n ame,&p-stude nt.sx,&p-studen t.dx,&p-stude nt.ts,&p-stude nt.dl,&p-stude nt.cx);p-stude nt.zf=p-stude nt

11、.sx+p-stude nt.dx+p-stude nt.ts+p-stude nt.dl+p-stude nt.cx;p-stude nt.pj=p-stude nt.zf/5;p-n ext=*headp;*headp=p;printf(* 插入成功 *n); void delet(struct studcode *headp)struct studcode *p,*last;long x;p=*headp;printf(请输入你要删除的学生的学号:);scan f(%ld, &x);while(p-stude nt.n um!=x&p-n ext!=NULL) last=p;p=p-n

12、ext;if(p-stude nt. num=x)if(p=*headp)iFFF-r-F-FFF一扌彳-F-FFF-i -F.-F- XFFF*FFXF* *headp=p-n ext;elselast- n ext=p-n ext;free(p);printf(n*删除成功 *n);else prin tf(n*删除失败,无该学生信息 *n); void good(struct studcode *head)struct studcode *p;int x1,x2,x3,x4,x5,k;float y1,y2,y3,y4,y5;x1=x2=x3=x4=x5=k=0;p=head;while

13、(p!=NULL)k+;if(p-student.sx=90) x1+;if(p-stude nt.dx=90) x2+;if(p-student.ts=90) x3+;if(p-student.dl=90) x4+;if(p-stude nt.cx=90) x5+;p=p-n ext;y1=(float)x1/k;y2=(float)x2/k;y3=(float)x3/k;y4=(float)x4/k;y5=(float)x5/k;printf(高数t读写t听说t导论t程序n);prin tf(%-0.2ft%-0.2ft%-0.2ft%-0.2ft%-0.2fn,y1,y2,y3,y4,y5); void fail(struct studcode *head)struct studcode *p;int x1,x2,x3,x4,x5,k;float y1,y2,y3,y4,y5;x1=x2=x3=x4=x5=k=0;p=head;while(p!=NULL)k+;if(p-student.sxstudent.dxstudent.ts60) x3+;if(p

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 活动策划

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号