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 |
结果什么不对????!!# 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator