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 10052130112 at 2006-12-03 23:27:03 on Problem 2242
#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:
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