全文预览

c语言职工工资管理系统设计报告

上传者:你的雨天 |  格式:doc  |  页数:14 |  大小:86KB

文档介绍
while(i<n) Р { Р fprintf(fp,"%s %s %lf %lf %lf %lf %lf %lf\n",stu[i].id,stu[i].name,stu[i].base,stu[i].position,stu[i].allowance,stu[i].insurance,stu[i].fund,stu[i].wage); Р ?i++; Р } Р fclose(fp); /*关闭文件*/ Р printf("保存成功!\n"); Р} Рvoid Read(Student stu[]) Р{ Р FILE *fp; Р int i; Р char filename[20]; Р strcpy(filename,"output");Р if((fp=fopen(filename,"r"))==NULL) Р { Р printf("找不到%s文件!\n",filename); Р system("pause"); Р return ; Р } Р n=0; Р for(i=0;i<100&&!feof(fp);i++) //这里的100 是前面已经说明了最多可以存100条记录Р { Р fscanf(fp,"%s %s %lf %lf %lf %lf %lf %lf \n",stu[i].id,&stu[i].name,&stu[i].base,&stu[i].position,&stu[i].allowance,&stu[i].insurance,&stu[i].fund,&stu[i].wage);

收藏

分享

举报
下载此文档