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

Re:We guarantee the triangle and the circle are not degenerate.

Posted by wolfshow at 2006-08-29 11:16:00 on Problem 2986
In Reply To:We guarantee the triangle and the circle are not degenerate. Posted by:wywcgs at 2006-08-29 11:03:03
我也是本着这句话做的,但事实似乎证明的确有几乎共线的数据。
#include<stdio.h>
#include<math.h>
double det(double a,double b,double c,double d)
{
	return a*d-b*c;
}
#define eps 1e-8
int main()
{
	int cc;
	double x[5],y[5],r;
	while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf%lf",
		&x[1],&y[1],&x[2],&y[2],&x[3],&y[3],&x[4],&y[4],&r)==9)
	{
		if(fabs(det(x[2]-x[1],y[2]-y[1],x[3]-x[1],y[3]-y[1]))<eps)
		while(1)
		{
			;
		}
	}
	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