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

为什么会WA呢?测试数据都通过了啊。

Posted by 597503076 at 2009-03-19 09:17:26 on Problem 2242
#include<stdio.h>
#include<stdlib.h>
#include<math.h>

#define PI 3.141592653589793
int main()
{
	int flag=1;
	double i,j,k,l,m,n,a,b,c,s,t,r;
	while(flag==1)
	{
		scanf("%lf %lf %lf %lf %lf %lf",&i,&j,&k,&l,&m,&n);
		a=sqrt((i-k)*(i-k)+(j-l)*(j-l));
		b=sqrt((i-m)*(i-m)+(j-n)*(j-n));
		c=sqrt((k-m)*(k-m)+(l-n)*(l-n));
		s=(a+b+c)/2.0;

		r=a*b*c/(4*sqrt(s*(s-a)*(s-b)*(s-c)));
		t=PI*2*r;
		if(t>=3141592.65)
		{
			printf("%.2f\n",t);
			flag=0;
		}
		else
		{
			flag=1;
            printf("%.2f\n",t);     
		}
	}
	printf("本次输入已截止!\n");
	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