| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 566 人关注过本帖
标题:Pathfinder的问题,请大神指点一二!
取消只看楼主 加入收藏
maxyu718
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2013-11-22
结帖率:0
收藏
已结贴  问题点数:20 回复次数:2 
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,但是我看不太懂,因为是菜鸟,求大神指点一二!谢谢啦
搜索更多相关主题的帖子: between starting numbers moving before 
2013-11-22 08:31
maxyu718
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2013-11-22
收藏
得分:0 
回复 2楼 peach5460
谢谢,我会google翻译,我想问这个具体应该怎么执行
2013-11-22 09:00
maxyu718
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2013-11-22
收藏
得分:0 
回复 5楼 peach5460
我是想了解一下这个project的思路,代码也可以。
2013-11-24 00:03
快速回复:Pathfinder的问题,请大神指点一二!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011959 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved