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 tw_126 at 2008-02-01 03:38:46 on Problem 1547
#include<iostream.h>
int main()
{
	int n;
	char x[10][8];
	int a[10],b[10],c[10];
	int max,min;
	int d;
	int j=0,m=0;
	cin>>n;
	while(n!=-1)
	{
		max=0;
		min=250;	
		j=0;
		m=0;
		for(int i=0;i<n;i++)
		{
			cin>>a[i]>>b[i]>>c[i]>>x[i];
		    d=a[i]*b[i]*c[i];
			if(d>max)
			{
				j=i;
				max=d;
			}
			if(d<min)
			{
				m=i;
				min=d;
			}			
		}
		cout<<x[j]<<" took clay from "<<x[m]<<'.'<<endl;
		cin>>n;	
	}
	return 0;
}

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