




已阅读5页,还剩1页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
#define N 1000#define M 3#include#includestruct studentint num;char name10;char sex4;int scoreM;int total;void input(struct student st,int n)int i;for(i=0;in;i+)scanf(%d%s%s%d%d%d,&sti.num,,sti.sex,&sti.score0,&sti.score1,&sti.score2);printf(n); for(i=0;in;i+)sti.total=sti.score0+sti.score1+sti.score2;void sort_sum(struct student st,int n)int i,j;struct student temp;for(i=0;in-1;i+)for(j=i+1;jn;j+)if(sti.totalstj.total)temp=sti;sti=stj;stj=temp;void seek_1(struct student st,int no,int n) int i,j,low,mid,high;struct student temp;for(i=0;in-1;i+)for(j=i+1;jstj.num)temp=sti;sti=stj;stj=temp;low=0;high=n-1;while (lowstmid.num)low=mid+1;else if (nostmid.num)high=mid-1;elseprintf(num:%d,name:%s,sex:%s,score:%d,%d,%d,total:%dn,stmid.num,,stmid.sex,stmid.score0,stmid.score1,stmid.score2,stmid.total);break;void seek_2(struct student st,int no,int n)int i;for(i=0;in;i+)if(no=sti.num) printf(num:%d,name:%s,sex:%s,score:%d,%d,%d,total:%dn,sti.num,,sti.sex,sti.score0,sti.score1,sti.score2,sti.total);void del(struct student st,int no,int n) int i,j;for(i=0;in-1;i+)if(no=sti.num)for(j=i;jn-1;j+)stj=stj+1;答案补充 void ins(struct student st,int n)printf(shuru xuesheng xinxin); scanf(%d%s%s%d%d%d,&stn.num,,stn.sex,&stn.score0,&stn.score1,&stn.score2);stn.total=stn.score0+stn.score1+stn.score2;答案补充 void mod(struct student st,int no,int n) int i;for(i=0;in;i+)if(no=sti.num) printf(xiugai xuesheng xinxin); scanf(%d%s%s%d%d%d,&sti.num,,sti.sex,&sti.score0,&sti.score1,&sti.score2);答案补充 void print(struct student st,int n)int i,j; struct student temp;for(i=0;in-1;i+)for(j=i+1;jstj.num)temp=sti;sti=stj;stj=temp;for(i=0;in;i+) printf(num:%d,name:%s,sex:%s,score:%d,%d,%d,total:%dn,sti.num,,sti.sex,sti.score0,sti.score1,sti.score2,sti.total);答案补充 void menu()printf( 1. 录入学生信息n); printf( 2. 根据总分排序n); printf( 3. 用折半法查找学生信息n); printf( 4. 用顺序法查找学生信息n); printf( 5. 根据学号删除学生信息n); printf( 6. 插入学生信息n); printf( 7. 根据学号修改学生信息n); printf( 8. 以报表形式输出学生信息n);printf( 0. 退出n);答案补充 void main()int choice,i,n;struct student stN;printf(-nn);printf( 欢迎进入学生成绩管理系统nn); printf(-nn); menu();while(choice!=0)printf(please choosen);scanf(%d,&choice);switch(choice)case 1:printf(please enter nn); scanf(%d,&n); input(st,n); menu(); break;case 2:sort_sum(st,n); menu(); break;答案补充 case 3:printf(enter the numn); scanf(%ld,&i); seek_1(st,i,n); menu(); break; case 4:printf(enter the numn); scanf(%ld,&i); seek_2(st,i,n); menu(); break;case 5:printf(enter the num you want to deln); scanf(%ld,&i); del(st,i,n); menu(); break;答案补充 case 6:ins(st,n); menu(); break; case 7:printf(enter the num you want to modn); scanf(%ld,&i); mod(st,
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 部门级安全培训材料课件
- 【高考模拟】2026届普通高等学校招生全国统一考试最 新 数学模拟试卷3(含解析)
- 海藻酸盐包装力学优化-洞察及研究
- 部署消防安全培训课件
- 遨游汉字课件
- 2023-2024学年广州市东江外语实验学校八年级(下)第一次限时训练物理试题
- 2025年广东省广州市中考物理三轮冲刺《机械运动》
- 国际标准体系差异对出口型刨刀产品认证成本的结构性挤压效应
- 口腔解剖变异区域刮治效率提升的3D打印定制化工具设计
- 反向刮水器总成在极端环境(-40℃至85℃)下的热应力变形补偿机制
- 2025低压电工复审考试题库及答案
- TSG 07-2019 特种设备生产和充装单位 许可规则
- 电梯维保服务评价与改进措施
- 施工质量标准化手册之桥涵工程
- 彩色沥青合同协议
- 医院培训课件:《环境卫生学监测的方法》
- 中队辅导员培训材料
- 2025年巷道掘砌工(技师)职业技能鉴定理论考试题库(含答案)
- 深度解析Palantir介绍
- 小学五爱教育
- 玻璃幕墙维修保养施工方案
评论
0/150
提交评论