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 |
怎么一个c的程序按照gcc提交wr,按照c++提交就ac了,,,,真搞不懂啊,,,,#include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <math.h> #include <string.h> int cmp(const void *a, const void *b) { return *(unsigned int*)a - *(unsigned int *)b; } int main() { unsigned int i,n; unsigned int s[250001]; scanf("%u",&n); for(i=0;i<n;i++) scanf("%u",s+i); qsort(s,n,sizeof(unsigned int),cmp); double res=(double)s[n/2]+(double)s[(n-1)/2]; printf("%.1llf",res/2.0); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator