全文预览

C程序经典100例 学习必备

上传者:梦&殇 |  格式:pdf  |  页数:156 |  大小:9257KB

文档介绍
Ôþ]3ÿ 0@P`p?\r(?@@ 0)@\r 0@\r!"?#$%&p'(\r"stud")*\rL+,"-.\r2.+,012.\r#include"stdio.h"\rinclude"conio.h"\rstructstudent\r(\rcharnum[6];\rcharname[8];\rintscore[3];\rfloatavr;\r}stu[5];\rmain()\rinti,j,sum;EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\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:");\rseanf("%s",stu[i].name);\rsum=0;\rfor(j=0;j<3;j++)\r(\rprintf("score%d."j+l);\rscanf("%d",&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");EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\rfclose(fp);\rgetchf);\r}

收藏

分享

举报
下载此文档