c语言课程设计学生成绩管理系统(6)

时间:2026-01-18

c语言课程设计 c语言

if((fp=fopen("s_score.txt","rb+"))==NULL||(fp1=fopen("temp.txt","wb+"))==NULL) /*检查是否出错*/ {

printf("Cannot open this file.\n"); exit(0); }

printf("\nPLease shuru xiugai xuehao:"); scanf("%d",&i); getchar();

while((fread(&data,sizeof(data),1,fp))==1) {

j=atoi(data.xuehao); if(j==i) {

printf("xuehao:%s\nmingzi:%s\nnianling:%s\n",data.xuehao,data.mingzi,data.nianling);

printf("Please shuru mingzi:"); gets(data.mingzi);

printf("Please shuru shuxue score:"); gets(temp);data.score[0]=atof(temp); printf("Please input yingyu score:"); gets(temp);data.score[1]=atof(temp); printf("Please input wuli score:"); gets(temp);data.score[2]=atof(temp);

data.score[3]=data.score[0]+data.score[1]+data.score[2];

} fwrite(&data,sizeof(data),1,fp1); }

fseek(fp,0L,0); /*将位置指针移到离头文件0个字节处*/ fseek(fp1,0L,0);

while((fread(&data,sizeof(data),1,fp1))==1) {

fwrite(&data,sizeof(data),1,fp); }

fclose(fp); fclose(fp1); }

4. 删除模块:

c语言课程设计学生成绩管理系统(6).doc 将本文的Word文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:4.9 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:19元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219