| ||||||||||
| 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:We guarantee the triangle and the circle are not degenerate.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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator