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

结果什么不对????!!

Posted by tzj115 at 2007-08-09 15:43:21 on Problem 2610
# include <stdio.h>
# include <math.h>

int main()
{
	double x1,y1,x2,y2,x,y;
	int flag=0;
	scanf("%f%f%f%f",&x1,&y1,&x2,&y2);
	while(scanf("%f %f",&x,&y)!=EOF)
	{
		
		double d1=(x1-x)*(x1-x)+(y-y1)*(y-y1);
		double d2=(x2-x)*(x2-x)+(y-y2)*(y-y2);
		if(flag==0 && 4*d1<d2)
		{
			flag=1;
			printf("The gopher can escape through the hole at (%.3f,%.3f).\n",x,y);
		}
	}
	if(flag==0)
		printf("The gopher cannot escape.\n");
	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