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 22220000 at 2009-03-03 15:50:29 on Problem 2833
#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
int a[5000001];
int main()
{
    int n1,n2,n;
    while(scanf("%d%d%d",&n1,&n2,&n)!=EOF)
    {
        if(n1==0&&n2==0&&n==0)  break;
        for(int i=0;i<n;i++)
            scanf("%d",&a[i]);
        sort(a,a+n);
        double sum=0;
        for(int i=n2;i<n-n1;i++)
            sum=sum+a[i];
        printf("%lf\n",(double)sum/(n-n1-n2));
    }
}

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