全文预览

C语言编程100例

上传者:幸福人生 |  格式:pdf  |  页数:101 |  大小:6500KB

文档介绍
);\rfclose(fp);EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\r9100]\r:;ª¾P¿ÀP¿ª3]ÁžÂ€‚ƒ„¦}ÃÄÅÆ¿ÇÈÉ,\rÊ]ÁžÂWstz\rË̞ÂÍΪ}ístzËÌ}¥°ÏŒ‚¢£Rstud”x\r1.\r2.\rttinclude"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(z\npleaseinputNo.%dscore:\ni);\r(\rprintf("stuNo:");\rscanfstu[i].num);\rprintf("name:");EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\rscanf("%s”,stu[i].name);\rsum=O;\rfor(j=0;j<3;j++)\r{printf("score%d.”,j+1);\rscanf&stu[i].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(structstudent),1,fp)!=1)\rprintf("filewriteerror'n");\rfclose(fp);

收藏

分享

举报
下载此文档