Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
一直Running Error,有人帮忙看看吗?#include<stdio.h> #include<stdlib.h> int cmp ( const void *a , const void *b ) { return *(long *)a - *(long *)b; } void main() { long max,min,n,i,j;__int64 sum; long a[50001]; while(scanf("%ld%ld%ld",&max,&min,&n)) { sum=0L; if(max==0&&min==0&&n==0)break; else { for(i=0;i<n;i++) scanf("%ld",&a[i]); //quicksort(a,0,n-1); qsort(a,n,sizeof(a[0]),cmp); for(j=min;j<n-max;j++) sum+=a[j]; printf("%.6lf\n",(double)(sum)/(double)(n-min-max)); } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator