c语言程序设计62218教程.doc

  1. 1、本文档共47页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
我这是源代码已经调试过了,在VC++上运行成功了。 #include stdio.h /*I/O函数*/ #include stdlib.h /*其它说明*/ #include string.h /*字符串函数*/ #include conio.h /*屏幕操作函数*/ #include mem.h /*内存操作函数*/ #include ctype.h /*字符操作函数*/ #include alloc.h /*动态地址分配函数*/ struct score { int mingci; char xuehao[8]; char mingzi[20]; float score[6]; }data,info[1000]; int i,j,k=0; char temp[20],ch; FILE *fp,*fp1; void shuru() { if((fp=fopen(s_score.txt,ab+))==NULL) { printf(cannot open this file.\n); getch();exit(0); } for(i=0;i=1000;i++) { printf(\nPlease shuru xuehao:); gets(data.xuehao); printf(Please shuru mingzi:); gets(data.mingzi); printf(Please shuru yuwen score:); gets(temp);data.score[0]=atof(temp); printf(Please shuru shuxue score:); gets(temp);data.score[1]=atof(temp); printf(Please input yingyu score:); gets(temp);data.score[2]=atof(temp); printf(Please shuru wuli score:); gets(temp);data.score[3]=atof(temp); printf(Please shur huaxue score:); gets(temp);data.score[4]=atof(temp); data.score[5]=data.score[0]+data.score[1]+data.score[2]+data.score[3]+data.score[4]; fwrite(data,sizeof(data),1,fp); printf(another?y/n); ch=getch(); if(ch==n||ch==N) break; } fclose(fp); } void xianshi() { float s;int n; if((fp=fopen(s_score.txt,rb+))==NULL) { printf(Cannot reading this file.\n); exit(0); } for(i=0;i=1000;i++) { if((fread(info[i],sizeof(info[i]),1,fp))!=1) break; } printf(\nxuehao mingzi yuwen shuxue yingyu wuli huauxue zhongfen\n); for(j=0,k=1;ji;j++,k++) { info[j].mingci=k; printf(%6s %8s %3.1f %3.1f %3.1f %3.1f %3.1f %3.1f\n,info[j].xuehao,info[j].mingzi,info[j].score[0],info[j].score[1],info[j].score[2],info[j].score[3],info[j].score[4], info[j].score[5]); } getch(); fclose(fp); } void xiugai() { if((fp=fopen(s_score.txt,rb+))==NULL||(fp1=fopen(temp.txt,wb+))==NULL) { printf(Cannot open

文档评论(0)

taotao0c + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档