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

unkonwn!help

Posted by mece at 2004-11-22 17:09:23 on Problem 1862
不知错在哪?

#include<stdio.h>
#include <math.h>
#define Max 11000
int main()
{
	int i,j,n,m,a[Max]={0},mark;
	double min;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&m);
		a[i]=m;
	}
	for(i=0;i<n;i++)
		for(j=i+1;j<n;j++)
			if(a[i]<a[j]) {mark=a[i];a[i]=a[j];a[j]=mark;}
	min=2*sqrt((double)a[0]*(double)a[1]);
	for(i=2;i<n;i++)
		min=2*sqrt(min*(double)a[i]);
	printf("%.3lf\n",min);
	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