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

求救!小弟是位新人,交了N次都WRONG 不行了,高手请指点2242

Posted by xuxin123 at 2007-06-02 20:18:52
#include<stdio.h>
#include<math.h>
main()
{
	double jie[1000];
	double i;
	int m=0;
	double x1,y1,x2,y2,x3,y3,x,y,r,l;
	while(i<1000000.0)
	{
		scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3);
		x=((y2*y2-x1*x1+x2*x2-y1*y1)*(y3-y1)-(x3*x3+y3*y3-x1*x1-y1*y1)*(y2-y1))/(2*(x2-x1)*(y3-y1)-2*(y2-y1)*(x3-x1));
		y=((y2*y2-x1*x1+x2*x2-y1*y1)*(x3-x1)-(x3*x3+y3*y3-x1*x1-y1*y1)*(x2-x1))/(-2*(x2-x1)*(y3-y1)+2*(y2-y1)*(x3-x1));
		r=sqrt((x2-x)*(x2-x)+(y2-y)*(y2-y));
		
		l=2.0*3.141592653589793*r;
	    i=r*2.0;
		jie[m]=l;
		m++;
	}
    for(int n=0;n<m;n++)
	{
		double q=jie[n];
		printf("%.2lf\n",q);
	}
	

	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