- 1、本文档共47页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 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
您可能关注的文档
最近下载
- 群体性建筑施工管理的探讨.doc
- 字节跳动人才管理体系解析(68页 PPT).pptx VIP
- 几何模型一猪蹄模型.docx VIP
- 雅思阅读核心学术词汇表(中英对照版).pdf
- 2024年江西省九江市公安局交管支队招聘辅警73人历年高频考题难、易错点模拟试题(共500题)附带答案详解.docx VIP
- 学霸暑期学习计划表.xlsx VIP
- RPA赋能流程智能化升级自主研发推动数字员工规模化制造_机器人流程自动化RPA技术交流课件.pptx
- 2024年九省联考广西高考化学卷真题.pdf
- 译林版八年级上册英语精品教学课件 unit 1 Friends Welcome to the unit.ppt VIP
- 污水厂消防安全注意事项.pdf VIP
文档评论(0)