??\r@A./?BC&-67D>??-@A6EFGH2“stud”\r1 .?\r2 .?\r#include "stdio.h"\rstruct student\r{ char num[6" /> ??\r@A./?BC&-67D>??-@A6EFGH2“stud”\r1 .?\r2 .?\r#include "stdio.h"\rstruct student\r{ char num[6" />

全文预览

C语言经典一百题

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

文档介绍
har(c[i]);\r)\rfclose(fp);\r"?100#\r$%&'()?*()&3 +,-./?012\r34567(89():?;<?=+,./)\r>??\r@A./?BC&-67D>??-@A6EFGH2“stud”\r1 .?\r2 .?\r#include "stdio.h"\rstruct student\r{ char num[6];\rchar name[8];\rint score[3];\rfloat avr;\r} stu[5];\rmain()\r{int i,j,sum;\rFILE *fp;\r/input*/\rfor(i=0;i<5;i++).\r{ printf(n\n please input No. %d score:\n",i);\rprintf("stuNo:");\rscanf(n%s",stu[i].num);\rprintf(nname:");\rscanf(H%s",stu[i].name);\rsum=0;\rfor(j=0;j<3;j++)\r{ printfC^core %d.n,j+1);\rscanf(n%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(struct student), 1 ,fp)!=1)\rprintf(Hfile write error\n");\rfclose(fp);\r)

收藏

分享

举报
下载此文档