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

为什么会是 WRONG ANSWER? HELP~~~~~~~~~

Posted by wadexy at 2006-03-27 20:31:17 on Problem 1547
#include<iostream>
#include<math.h>
using namespace std;

int main()
{
	int n[11][5]={0};
	char name[11][10];
	int student=0;
	while (student!=-1)
	{
		int maxClay=n[1][4],minClay=n[1][4];
		int max=1,min=1;
		cin>>student;
		if (student==-1)
			break;
		for (int j=1;j<=student;j++)
		{
			cin>>n[j][1]>>n[j][2]>>n[j][3];
			n[j][4]=n[j][1]*n[j][2]*n[j][3];
			cin>>name[j];
		}

		for (int p=1;p<=student;p++)
		{

			if (n[p][4]>maxClay)
			{
				maxClay=n[p][4];
				max=p;
			}
		}

		for (int q=1;q<=student;q++)
		{

			if (n[q][4]<=minClay)
			{
				minClay=n[q][4];
				min=q;
			}
		}

		cout<<name[max]<<" took clay from "<<name[min]<<"."<<endl;
	}
}

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