



免费预览已结束,剩余1页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
#include #include #include #define M 3 #define B 3 #define S 6 typedef char datatype;typedef char keytype;typedef struct char num8; char name10; int chin;int phy;int chem;int eng; STUDENT; STUDENT studM;typedef struct keytype key8; STUDENT stu; TABLE;typedef struct keytype key8; int low,high; INDEX;TABLE listM; INDEX inlistB; int save() FILE *fp; int i; if(fp=fopen(score.txt,wb)=NULL) printf(Canneot open file!n); return 0; printf(n文件的内容是:nn); for(i=0;iM;i+) fprintf(fp,%s,studi.num); printf(%s,studi.num); fprintf(fp,%s,); printf(%s,); fprintf(fp,%s,studi.chin); printf(%s,studi.chin); fprintf(fp,%s,studi.phy); printf(%s,studi.phy); fprintf(fp,%s,studi.chem); printf(%s,studi.chem); fprintf(fp,%s,studi.eng); printf(%s,studi.eng); fprintf(fp,n); printf(n); fclose(fp);void creat() int i; printf(请输入18个学生号、名字、四门成绩:n); for(i=0;iM;i+) scanf(%s%s%d%d%d%d,studi.num,,&studi.chin,&studi.phy,&studi.chem,&studi.eng); save();void readtxt(void) FILE *fp; int i,d; char max8; fp=fopen(score.txt,r); for(i=0;iM;i+) fscanf(fp,%s,listi.stu.num); fscanf(fp,%s,); fscanf(fp,%d,&listi.stu.chin); fscanf(fp,%d,&listi.stu.phy); fscanf(fp,%d,&listi.stu.chem); fscanf(fp,%d,&listi.stu.eng); strcpy(listi.key,listi.stu.num); for(i=0;iB;i+) inlisti.low=i+(i*(S-1); inlisti.high=i+(i+1)*(S-1); strcpy(max,list0.stu.num);d=0;for(i=1;iM;i+) if(strcmp(max,listi.stu.num)0) strcpy(max,listi.stu.num); if(i+1)%6 = 0 ) strcpy(inlistd.key,max); d+; if(iM-1) strcpy(max,listi+1.stu.num);i+; fclose(fp); void modify (char *key,int kc,int cj) int low1=0,high1=B-1,mid1,i,j; int flag=0; while(low10) high1=mid1-1; else low1=mid1+1; if (low1B) i=inlistlow1.low;j=inlistlow1.high; while(ij & strcmp(listi.key,key) i+; if(strcmp(listi.key,key)=0) if(kc=1) listi.stu.chin=cj; else if(kc=2) listi.stu.phy=cj; else if(kc=3) listi.stu.chem=cj; else if(kc=4) listi.stu.eng=cj;void writetxt(void) FILE *fp; int i; fp=fopen(score.txt,w); for(i=0;iM;i+) fprintf(fp,%s ,listi.stu.num); fprintf(fp,%s ,); fprintf(fp,%d ,listi.stu.chin); fprintf(fp,%d ,listi.stu.phy); fprintf(fp,%d ,listi.stu.chem); fprintf(fp,%d ,listi.stu.eng); fprintf(fp,n); fclose(fp); int main( ) int kc,cj; creat(); char key8; printf(请输入欲修改成绩的学生号!n); gets(key); printf(选择欲修改成绩的课
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年私募基金行业当前竞争格局与未来发展趋势分析报告
- 2025年汽车产业园行业当前市场规模及未来五到十年发展趋势报告
- 收入科目课件
- 2025年住院医师规范化培训院级师资考核试题(含答案)
- 2025年矿产权评估师重点试题带答案
- 2024年事业单位考试内江市东兴区《公共基础知识》全真模拟试题含解析
- 播放课件不显示页数问题
- 2025年初级卫生专业技术资格练习题有参考答案
- 2025年施工员之装修施工基础知识考试题库附完整答案(必刷)
- 2025年公务员考试公共基础知识模拟试题及答案
- 2025健康体检服务规范
- 税务政策培训课件
- 循环水培训课件
- 大型丧事活动方案
- 阿尔茨海默氏症典型病例解析
- 2025年中小学心理健康教育教师考试试题及答案
- 教师写作培训课件
- 中国无人机智能巡检系统行业市场前景预测及投资价值评估分析报告
- 十五五林业建设总结和十五五林业发展规划思路-0-图文
- 财务分析入门从零开始学
- 2025年航拍无人机驾驶员(五级)职业技能鉴定理论考试题库(含答案)
评论
0/150
提交评论