全文预览

经典c程序100

上传者:非学无以广才 |  格式:pdf  |  页数:71 |  大小:5199KB

文档介绍
wascreatedwithSpire.PDFfor.NET.\r100]\r!"oƒ.„…,†.„…o3‡ˆi_‰,#$%&'j5Š‹(Œ„…Ž,,‘‡\rˆ_‰),’“c\r”•_‰,–—oiŠ‹q’“ci”•?Šhs˜4%de“stud”f;\r1.?@"\r2.ABC"\r#include"stdio.h"\r#include"conio.h"\rstructstudent\r{\rcharnum[6];\rcharname[8];\rintscore[3];\rfloatavr;\r}stu[5];\rmain()\r(\rintij,sum;\rFILE*fp;\rBinput*/\rfor(i=0;i<5;i++)\r(\rprintf(M\npleaseinputNo.%dscore:\n",i);\rprintf(MstuNo:");\rscanf("%sU,stu[i].num);\rprintf("name:\rscanf(u%s0,stu[i].name);\rsum=0;\rfor(j=0;j<3;j++)\r(\rprintf(nscore%d.",j+l);\rscanf(n%dn,&stu[i].score[j]);\rsum+=stu[i].score[j];\r)\rstu[i].avr=sum/3.0;\r)\rfp=fopen("stud","wu);\rfor(i=0;i<5;i+4-)\rif(fwrite(&stu[i],sizeof(structstudent),1,fp)!=1)\rprintf(Hfilewriteerror\n");\rfclose(fp);\rgetch();EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\r}

收藏

分享

举报
下载此文档