| ||||||||||
| 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 | |||||||||
Re:我觉得这样看着更好些 该上面的代码In Reply To:给出公式! 不需要解析几何! Posted by:810974380 at 2009-08-03 15:46:30 #include<stdio.h>
#include<math.h>
#define pi 3.141592653589793
main()
{
double x1, y1, x2, y2, x3, y3, a, b, c, s, d, p;
while(scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3)!=EOF)
{
a = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
b = sqrt((x3-x1)*(x3-x1) + (y3-y1)*(y3-y1));
c = sqrt((x3-x2)*(x3-x2) + (y3-y2)*(y3-y2));
p = (a+b+c)/2;
s = sqrt(p*(p-a)*(p-b)*(p-c));
d = a*b*c/s;
printf("%.2lf\n",d*pi/2);
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator