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

Re:呵呵,改了你的代码

Posted by kric at 2007-03-16 21:09:59 on Problem 1547
In Reply To:Re:呵呵,改了你的代码 Posted by:kric at 2007-03-16 21:09:42
#include<iostream>
using namespace std;
int main()
{
	char p[9][8];
	int n,i,a,b,c,min,max,*q;
	while(1)
	{
		cin>>n;
		if(n==-1)
			return 1;
		q=new int [n];
		for(i=0;i<n;i++)
		{
			cin>>a>>b>>c>>p[i];
			q[i]=a*b*c;
		}
		max=min=0;
		for(i=1;i<n;i++)
		{
			if(q[i]>q[max])
				max=i;
			if(q[i]<q[min])
				min=i;
		}
		cout<<p[max]<<" took clay from "<<p[min]<<"."<<endl;
		
	}
	return 1;
}

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