文件名称:qishixunyou
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:312.34kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
编写程序求解骑士巡游问题:在n行n列的棋盘上(如n=5),假设一位骑士(按象棋中“马走日”的行走法)从初始坐标位置(x1,y1)出发,要遍访(巡游)棋盘中的每一个位置一次。请编一个程序,为骑士求解巡游“路线图”(或告诉骑士,从某位置出发时,无法遍访整个棋盘 — 问题无解)。
当n=5时,意味着要在5行5列的棋盘的25个“点”处,按骑士行走规则,依次将1至25这25个“棋子”(数码)分别摆放到棋盘上(摆满25个位置则成功,否则失败问题无解)。例如,当n=5且初始坐标位置定为(1,1) — 即最左上角的那个点时,如下是一种巡游“路线图”。程序执行后的输出结果为:
(x1,y1)? => (1=>5, 1=>5) : 1 1
1    6  15  10  21
14    9  20    5  16
19    2    7  22  11
8  13  24  17    4
25  18    3  12  23-Knight Parade programming to solve the problem: in n rows n columns of the board (such as n = 5), assuming a knight (in chess in the "horse to go on" walking method) from the initial coordinates (x1, y1) starting , to be sung (Parade) board in the position of each of the first. Please compile a program to solve for the Knight Parade "road map" (or tell the knight, starting from a position when not visiting with the board- the problem no solution).
当n=5时,意味着要在5行5列的棋盘的25个“点”处,按骑士行走规则,依次将1至25这25个“棋子”(数码)分别摆放到棋盘上(摆满25个位置则成功,否则失败问题无解)。例如,当n=5且初始坐标位置定为(1,1) — 即最左上角的那个点时,如下是一种巡游“路线图”。程序执行后的输出结果为:
(x1,y1)? => (1=>5, 1=>5) : 1 1
1    6  15  10  21
14    9  20    5  16
19    2    7  22  11
8  13  24  17    4
25  18    3  12  23-Knight Parade programming to solve the problem: in n rows n columns of the board (such as n = 5), assuming a knight (in chess in the "horse to go on" walking method) from the initial coordinates (x1, y1) starting , to be sung (Parade) board in the position of each of the first. Please compile a program to solve for the Knight Parade "road map" (or tell the knight, starting from a position when not visiting with the board- the problem no solution).
(系统自动生成,下载前可以参看下载内容)
下载文件列表
qishixunyou/Debug/ba_queen.obj
qishixunyou/Debug/qishixunyou.obj
qishixunyou/Debug/qishixunyou.pch
qishixunyou/Debug/qishixunyou.pdb
qishixunyou/Debug/vc60.idb
qishixunyou/Debug/vc60.pdb
qishixunyou/qishixunyou.cpp
qishixunyou/qishixunyou.dsp
qishixunyou/qishixunyou.dsw
qishixunyou/qishixunyou.ncb
qishixunyou/qishixunyou.opt
qishixunyou/qishixunyou.plg
qishixunyou/Debug
qishixunyou
qishixunyou/Debug/qishixunyou.obj
qishixunyou/Debug/qishixunyou.pch
qishixunyou/Debug/qishixunyou.pdb
qishixunyou/Debug/vc60.idb
qishixunyou/Debug/vc60.pdb
qishixunyou/qishixunyou.cpp
qishixunyou/qishixunyou.dsp
qishixunyou/qishixunyou.dsw
qishixunyou/qishixunyou.ncb
qishixunyou/qishixunyou.opt
qishixunyou/qishixunyou.plg
qishixunyou/Debug
qishixunyou
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.