全文预览

经典C语言程序100例

上传者:火锅鸡 |  格式:pdf  |  页数:118 |  大小:6959KB

文档介绍
r)\rfclose(fp);\r)\r=100]\r?@½ÏhvÐ,Ñhvн3ÒÓx±Ô,š›œžº§Õ\rÖ×ØvÐÙ,ÚÛ0?ÒӱԌ0‘–\rÜݱÔ,Þß½xÕ?‘–xÜݹÁজµ¶\r“stud””.\r1.EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\r2.\rftinclude"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(0z\npleaseinputNo.%dscore:\nz0,i);\rprintf("stuNo:");\rscanfstu[i].num);\rprintf("name:");\rscanfstu[i].name);\rsum=0;\rfor(j=0;j<3;j++)\r{printf("score%d.”,j+1);\rscanf&stu[i].score[j]);EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\rsum+=stu[i].score[j];\r)\rstu[i].avr=sum/3.0;\r)\rfp=fopen("stud","wJ);\rfor(i=0;i<5;i++)\rif(fwrite(&stu[i],sizeof(structstudent),1,fp)!=1)\rprintf(''filewriteerror'n");\rfclose(fp);

收藏

分享

举报
下载此文档