全文预览

c语言经典编程100

上传者:叶子黄了 |  格式:pdf  |  页数:61 |  大小:4762KB

文档介绍
Warning : The document was created with Spire.PDF for .NET.\rfclose(fp);\r)\r`P ` 100]\rab\n›¯z°±8²z°±›3 ³´lµ8rstuv—n¶(·¸°±¹8º»8¼³´ µ )8cdj\r½¾µ8¿À›ln¶žcdjl½¾?n–¡Á€t“”%stud%h†\r1 .P`?\r2 .P`\r??\rttinclude "stdio. h%\rstruct student\r{ char num[6];\rchar name[8];\rint score[3];\rfloat avr;\r} stu[5];\rmain()\r{int i, j, sum;\rFILE *fp;\r/*input*/\rfor(i=0;i<5;i++)\r{ printf C'\n please input No. %d score:\n%8i);\rprintf("stuNo:%);\rscanf ("%s%8stu[i]. num);\rprintf(%name:%)<\rscanf (%%s%8stu[i]. name);\rsum=0;\rfor(j=0;j<3;j++)\r{ printf ("score %d. %, j+1);\rscanf score[j]);\rsum+=stu[i]. score[j];\r)\rstu[i].avr=sum/3. 0;\r)\rfp=fopen(%stud%,%w%)<\rfor(i=0;i<5;i++)\rif(fwrite(&stu[i], sizeof(struct student), 1,fp)!=1)\rprintf (z/file write error\nz8);\rfclose(fp);

收藏

分享

举报
下载此文档