Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

看不出来,这也错了??郁闷!哥们帮个忙!!谢谢

Posted by ACM05001_dz0302 at 2005-07-29 02:13:16 on Problem 1547
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator