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 |
看不出来,这也错了??郁闷!哥们帮个忙!!谢谢#include <stdio.h> #include <string.h> void main() {int t,i,a,b,c,m[10],temp; char n[10][9],s[9]; while(1){ scanf("%d",&t); if(t==-1)break; for(i=1;i<=t;i++) {scanf("%d%d%d%s",&a,&b,&c,n[i]); m[i]=a*b*c;} for(i=2;i<=t;i++) if(m[1]<m[i]) {temp=m[1];m[1]=m[i];m[i]=temp; strcpy(s, n[1]);strcpy(n[1], n[i]); strcpy(n[i], s); } for(i=3;i<=t;i++) if(m[2]>m[i]) {temp=m[2];m[2]=m[2];m[2]=temp; strcpy(s, n[2]);strcpy(n[2], n[2]); strcpy(n[2], s);} printf("%s took clay from %s.\n\n",n[1],n[2]); }} Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator