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

注意!!!%lf输入%f输出!这是必要的!不然你看着办!

Posted by chenxuan123456789 at 2012-08-10 11:28:56 on Problem 2242
#include <stdio.h>
#include <math.h>
#define PI 3.141592653589793
double a[3][2];
int main()
{
	double a1,b1,c1,p,area,d;
	int i;
	while(scanf("%lf%lf%lf%lf%lf%lf",&a[0][0],&a[0][1],&a[1][0],&a[1][1],&a[2][0],&a[2][1])!=EOF)
	{
		a1=sqrt((a[0][0]-a[1][0])*(a[0][0]-a[1][0])+(a[0][1]-a[1][1])*(a[0][1]-a[1][1]));
		b1=sqrt((a[0][0]-a[2][0])*(a[0][0]-a[2][0])+(a[0][1]-a[2][1])*(a[0][1]-a[2][1]));
		c1=sqrt((a[1][0]-a[2][0])*(a[1][0]-a[2][0])+(a[1][1]-a[2][1])*(a[1][1]-a[2][1]));
		p=(a1+b1+c1)/2;
		area=sqrt(p*(p-a1)*(p-b1)*(p-c1));
		d=(a1*b1*c1)/(2*area);
		printf("%.2f\n",d*PI);
	}
	return 1;
}

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