全文预览

c程序设计答案

上传者:梦溪 |  格式:pdf  |  页数:70 |  大小:11917KB

文档介绍
);\rfclose(fp);\rn=i;\rprintfCd\n Input name deleted:^^);\rscanf("@s”,name);\rfor (flag=l,i=O;flag && i<n;i++)\r{if (strcmp(name,emp[iJ.name)==O)\r{for(j=i;j<n-l;j++)\r{strcpy (emp |j J. name,emp|j+ l].name);\remp[j].salary=emp[j+l].salaiy;\r)\rflag=0;\r)\r)\rif(!flag)\rn=n-l;\relse\rprintf("\n Not found!”)9\rprintf(44\nNow,the content of file:\n’')9\rfp=fopen("emp_salary","wb'');\rfor (i=0;i<n;i++)\rfwrite(&emp[i],sizeof(struct emploee),l,fp);\rfclose(fp);\rfp=fopen("emp_salary“9T")9\rfor (i=0;fread(&emp[i],sizeof(struct emploee), 1 ,fp)!=0;i++)\rprintf(t<\n%8s %7d,,,emp[i].name,emp[i].salary);\rfclose(fp);\r)\r67ABCD5\roriginal data:\rLi 670\rWang 780\rMa 650\rLiu 540\rInput name deleted: M a/\rNow,the content of file:\rLi 670\rWang 780\rLiu 540\r70

收藏

分享

举报
下载此文档