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 1152230301 at 2011-07-08 20:25:12 on Problem 3507
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
 
		double a[6],ava;
	while(scanf("%lf%lf%lf%lf%lf%lf",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5])!=EOF&&a[1]&&a[2]&&a[3]&&a[4]&&a[5]&&a[0])
	{	
		sort(a,a+6);
		ava=(a[1]+a[2]+a[3]+a[4])/4.0;
		printf("%g\n",ava);
			
	}
	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