全文预览

C程序设计

上传者:苏堤漫步 |  格式:pdf  |  页数:77 |  大小:3729KB

文档介绍
mentwascreatedwithSpire.PDFfor.NET.\r{inti,j,max,maxi,sum;\rfloataverage;\rfor(i=0;i<5;i++)\r{printf("number");\rscanf("%sM,stu[i].num);\rprintf("name");\rscanf("%s",stu[i].name);\rfor(j=0;j<3;j++)\r{printf("\nscore\rT);\rscanf("%d",&stu[i].score[j]);\r)\r)\raverage=0;\rmax=0;\rmaxi=0;\rfor(i=0;i<5;i++)\r{sum=0;\rfor(j=0;j<3;j++)\rsum+=stu[i].score[j];\rstu[i].avr=sum/3.0;\raverage+=stu[i].avr;\rif(sum>max)\r{max=sum;\rmaxi=i;\r)\r}\raverage/=5;\rprintf("numbernamescore1score2score3average"");\rfor(i=0;i<5;i++)\r{printf(w%8s%10sM,stu[i].num,stu[i].name);EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\rfor(j=0;j<3;j++)\rprintf("%7d",stu[i].score[j]);\rprintf("%6.2f\n",stu[i].avr);\r}\rprintf("average=%5.2f\n",average);\rprintff'Thebeststudentis%s,sum=%d\n',,stu[maxi].name.max);

收藏

分享

举报
下载此文档