Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
大牛们,Wrong answer,帮帮忙呀!!!!!!!!#include<stdio.h> #include<math.h> void main(){ int i,n,maxindex,minindex,max,min; int total[9]; scanf("%d",&n); while(n!=-1){ struct student{ int num1; int num2; int num3; char name[8]; }stu[9]; max=0; min=251; for(i=0;i<n;i++){ scanf("%d%d%d%s",&stu[i].num1,&stu[i].num2,&stu[i].num3,&stu[i].name); total[i]=stu[i].num1*stu[i].num2*stu[i].num3; if(total[i]>=max){ maxindex=i; max=total[i]; } if(total[i]<=min){ minindex=i; min=total[i]; } } printf("%s took clay from %s\n",stu[maxindex].name,stu[minindex].name); scanf("%d",&n); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator