| ||||||||||
| 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<math.h>
#define pi 3.141592653589793
int main()
{
double a,b,c;
double x1,x2,x3,y1,y2,y3;
float sinA,cosA,r;
while(scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3)!=EOF)
{
a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
b=sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
c=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
cosA=(b*b+c*c-a*a)/(2*b*c);
sinA=sqrt(1-cosA*cosA);
r=a/sinA;
printf("%.2f\n",pi*r);
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator