Pathfinder的问题,请大神指点一二!
Pathfinder. Write a text-based program that reads a set of coordinates from a text file and outputs on the screen the path that can visit all the coordinates starting from the first coordinate in the file, and at every step moving to the nearest coordinate that has not been visited before. The maximum number of coordinates in the file is 10. The format of the text file consists of one coordinate per line where the x,y point is described by two integer numbers between 0 and 100 separated by a coma and with no blank spaces in between. For example, a file with a set of four coordinates will be as follows:4,2
1,8
7,5
10,3
The path found by the program must start from 4,2 because it was the first coordinate in the list, and then it must continue to 7,5 because it is the closest coordinate to 4,2. Thus, the next coordinate must be 10,3 because it is the closest coordinate to 7,5. The final coordinate must be 1,8. The screen output should look like this: 4,2 --- 7,5 --- 10,3 --- 1,8. To run the program the user should type pathfinder <file_name>, where file_name is the file containing the coordinates.
这个是我们的一个project,但是我看不太懂,因为是菜鸟,求大神指点一二!谢谢啦