全文预览

经典C语言程序例

上传者:业精于勤 |  格式:pdf  |  页数:117 |  大小:7019KB

文档介绍
c[i]);\rfclose(fp);EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\r9\r100]\r;<¿ÑjyÒ,ÓjyÒ¿3‰Ô{´Õ,œžŸ ¼©RÖ\r(×ØyÒÙ,ÚÛ`‰Ô´Õ)’“™\rÜÝ´Õ,Þß¿{RÖP’“™{ÜÝ?R»Ãਞ¸¹\r“stud”—.\r1.\r??\r2.\r\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++)EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\r{printf(z\npleaseinputNo.%dscore:\n',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]);\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);

收藏

分享

举报
下载此文档