全文预览

经典C程序100例

上传者:塑料瓶子 |  格式:pdf  |  页数:61 |  大小:4839KB

文档介绍
");\rfp=fopen("C","w");\rfor(i=0;i<n;i++)\r{putc(c,fp);\rputchar(c);\r)\rfclose(fp);\r)\r??100]\r-:´âp†:´â3ãäPFåpÁÂÃ?=š(Y5(æç´âèpéê,\rKãäFå)p½¾\rDEFåpëQPY5o½¾\nPDEYÔؒÈÃÑÒ"stud"\r1.??\r2.??\r#include"stdio.h"\rstructstudent\r{charnum[6];\rcharname[8];\rintscore[3];\rfloatavr;\r}stu[5];\rmain()\r{inti,j,sum;\rFILE*fp;\r/*input*/\rfor(i=0;i<5;i++)\r{printf(n\npleaseinputNo.%dscore:\n",i);\rprintf(nstuNM);\rscanf(n%s,,,stu.num);EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\rprintf("name:")\rscanf(M%sH,stu.name);\rsum=O;\rfor(j=0;j<3;j++)\r{printf(Mscore%d.n,j+l);\rscanf("%d",&stu.score[j]);\rsum+=stu.score|j|;\r)\rstu.avn=sum/3.0;\r)\rfp=fopen("stud","wn);\rfor(i=0;i<5;i++)\rif(fwrite(&stu,sizeof(structstudent),l,fp)!=l)\rprintf(nfilewriteerror\n");\rfclose(fp);

收藏

分享

举报
下载此文档