| ||||||||||
| 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 | |||||||||
float -->double 就过了,#include <stdio.h>
#include <stdlib.h>
int cmp(const void *a,const void *b)
{
return *(int *)a-*(int *)b;
}
int main()
{
int num[250001];
int n,i,m;
double ans;
scanf("%d",&n);
for(i=0;i<n;i++) scanf("%d",num+i);
qsort(num,n,sizeof(int),cmp);
m=n/2;
printf("%.1lf",n%2?num[m]:num[m]/2.0+num[m-1]/2.0);
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator