c语言课程设计成绩管理系统代码

c语言课程设计成绩管理系统代码

ID:15088899

大小:41.50 KB

页数:12页

时间:2018-08-01

c语言课程设计成绩管理系统代码_第1页
c语言课程设计成绩管理系统代码_第2页
c语言课程设计成绩管理系统代码_第3页
c语言课程设计成绩管理系统代码_第4页
c语言课程设计成绩管理系统代码_第5页
资源描述:

《c语言课程设计成绩管理系统代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、C语言课程设计成绩管理系统代码#defineLsizeof(structstudent)#includestructstudent{charname[10];//姓名longnum;//学号charsex[3];//性别intgrade;//班级floatscore1,score2,score3,score4;//四门课成绩floatall;//总分floataverage;//平均分structstudentnext;//指向下一个结点的指针};structstudenthead

2、;//全局指针变量chara;voidinput(structstudentq){structstudentp;while(1){p=(structstudent)malloc(L);//开辟存储空间printf("输入姓名:");scanf("%s",p->name);printf("输入学号:");scanf("%ld",&p->num);printf("输入性别:");scanf("%s",p->sex);printf("输入班级:");scanf("%d",&p->grade);printf

3、("输入四门课成绩:");scanf("%f%f%f%f",&p->score1,&p->score2,&p->score3,&p->score4);fflush(stdin);p->all=p->score1+p->score2+p->score3+p->score4;p->average=p->all/4;p->next=q;q=p;printf("是否回主菜单(Y/N):");scanf("%c",&a);if(a=='Y'a=='y')break;}}voidadd(){structstud

4、entp1,p2;charc;p2=(structstudent)malloc(L);p1=head;while(1){while(p1->next!=0)p1=p1->next;printf("输入姓名:");scanf("%s",p2->name);printf("输入学号:");scanf("%ld",&p2->num);printf("输入性别:");scanf("%s",p2->sex);printf("输入班级:");scanf("%d",&p2->grade);printf("输入四门

5、课成绩:");scanf("%f%f%f%f",&p2->score1,&p2->score2,&p2->score3,&p2->score4);fflush(stdin);p2->all=p2->score1+p2->score2+p2->score3+p2->score4;p2->average=p2->all/4;p2->next=0;p1->next=p2;printf("是否回主菜单?(y/n):");scanf("%c",&c);fflush(stdin);if(c=='y'c=='Y'

6、)break;}}voidfind(structstudentp){longb;intflag;//判断标志while(1){printf("输入学号:");scanf("%ld",&b);flag=0;while(p!=0){if(p->num==b){printf("姓名t学号t性别t班级t语文t数学t外语t综合t总分t平均分");printf("%st%ldt%st%dt%.2ft%.2ft%.2ft%.2ft%.2ft%.2f",p->name,p

7、->num,p->sex,p->grade,p->score1,p->score2,p->score3,p->score4,p->all,p->average);flag=1;break;}//如果结点的学号和要查找的学号相等,输出结点信息,同时标志变为1elsep=p->next;//p指向下一结点}if(flag==0)//判断标志是0或1,确定循环结束的形式printf("无查询结果!");//若标志为0,提示无查找结果printf("是否回主菜单(Y/N):");fflush(stdin

8、);scanf("%c",&a);if(a=='Y'a=='y')break;}}voiddel(){structstudentp1,p2,p;chart;longb;intflag=0;while(1){printf("请输入学号:");scanf("%ld",&b);if(head->num==b){p=head;printf("姓名t学号t性别t班级t语文t数学t外语t综合t总分t平均分");printf("%st%ldt%st%d

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。