全文预览

经典c程序100例

上传者:菩提 |  格式:pdf  |  页数:97 |  大小:4075KB

文档介绍
lose(fp);\r)\rP`100J\r??5KLMNLM53OP/#Q0RSTUVWLMXYZ[\rOP#Q\]^'\r_`#Qab5/ST7]^'/_`pS.9c)*+"stud", \r1.P`p?\r2.P`\r#include"stdio.h"EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\rstructstudent\r{charnum[6];\rcharname[8];\rintscore[3];\rfloatavr;\r}stu[5];\rmain()\r{inti,j,sum;\rHLE*fp;\r/*input*/\rfor(d0;iv5;i++)\r{printf("\npleaseinputNo.%dscore:\n",i);\rprintf(HstuNo:n);\rscanf(H%s",stu[i].num);\rprintf(Hname:");\rscanf("%sH,stu[i].name);\rsum=0;\rfor(j=0;j<3;j++)\r{printf("score%d.HJ+1);\rscanf(”ed\&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(nfilewriteerror\nu);EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\rfclose(fp);\r)

收藏

分享

举报
下载此文档