全文预览

C语言经典例哟

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

文档介绍
;conio.h"EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\rstructstudent\rcharnum[6];\rcharname[8];\rintscore[3];\rfloatavr;\r}stu[5];\rmain()\r(\rintijsum;\rFILE*fp;\r/*input*/\rfor(i=0;i<5;i++)\r(\rprintf("\npleaseinputNo.%dscore:\n",i);\rprintf("stuNo:");\rscanf("%s",stu[i].num);\rprintf("name:");\rscanf("%s",stu[i].name);\rsum=0;\rfor(j=0;j<3;j++)EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\rprintf("score%d.",j+l);\rscanf("%d"z&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),l,fp)!=l)\rprintf("filewriteerror\n");\rfclose(fp);\rgetch();\r)

收藏

分享

举报
下载此文档