10310 - Dog and Gopher
Solution Description : Geometry problem Take the dog(dx, dy) and gopher(gx, gy) coordinates in, and for each point (x, y) that you get: gopherDis = sqrt((gx-x)^2 + (gy-y)^2)) dogDis = sqrt((dx-x)^2 + (dy-y)^2) if twice of gopher distance is less or equal dog distance then output "he escapes" else otherwise, he doesn't. Remember you need to find the minimum distance escape hole coordinate (x,y) |
||||||||||