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

怎么一个c的程序按照gcc提交wr,按照c++提交就ac了,,,,真搞不懂啊,,,,

Posted by 1531474017 at 2012-05-01 15:10:00 on Problem 2623
#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:
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