| ||||||||||
| 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 | |||||||||
为什么会WA呢?测试数据都通过了啊。#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator