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 happy__ting at 2010-06-01 19:11:03 on Problem 2833
#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
double a[50000];
int main()
{
	
	int i,n1,n2,n;
	double sum;
	while(scanf("%d%d%d",&n1,&n2,&n),n1+n2+n>0)
	{
		for(i=0;i<n;i++)
			scanf("%lf",&a[i]);
		sort(a,a+n);
		for(i=n2,sum=0;i<=n-n1-1;i++)
			sum+=a[i];
		printf("%.6f\n",sum/(n-n1-n2));
	}
	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