I have an assignment until next week and i don't know hot to complete it
In the program in c we have to help a cat escape from a dog which has double speed. The program works as follows :
the data of the program are read from the file CatAndDog.dat (the first line has the cat's coordinates, the second has the dog's ones, the third has the number of the trees that the cat can climbs on (max 1000) and the next n lines has the coordinates of the trees)
For example :
2.0 2.0
1.0 1.0
4
0.0 1.0
1.5 1.5
2.5 2.9
0.0 0.5
After doing this we have to check if the cat can escape by climbing on any tree. But this is the difficult for me because if there are two or more trees we should prefer the tree that is closer to initial position of the cat. Otherwise The cat cannot esacape.