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 lironghua at 2008-08-27 17:16:15 on Problem 3507
#include <iostream>

using namespace std;

int main ()
{
	int i;
	int max,min,a[6];
	double s,r;
	while (1)
	{
		for (i = 0; i < 6; i++)
			cin >> a[i];
		i = 0;
		while (i < 6 && a[i++] == 0);
		if (i == 6)
			break;
		s = a[0];
		max = a[0];
		min = a[0];
		for (i = 1; i < 6; i++)
		{
			s += a[i];
			if (a[i] > max)
				max = a[i];
			else if (a[i] < min)
				min = a[i];
		}
		
		s = s - max - min;
		r = s / 4.0;
		cout << r << 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