文件名称:bahuanghou
- 所属分类:
- 数据结构常用算法
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 221kb
- 下载次数:
- 0次
- 提 供 者:
- jian*****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
编写程序对八皇后问题进行求解:在8行8列的棋盘上放置8个皇后,使任一个皇后都不能吃掉其他的7个皇后(注:皇后可吃掉与她处于同行或同列或同一对角线上的其他棋子),并将结果以某种方式显示出来。
例如,当求出下述的一个解时,可输出如下信息来表示该解(输出了表示摆放皇后的坐标位置以及“棋盘状态”— 棋盘中有皇后的位置放一个“Q”字符,其他位置为“+”字符)。
(1,1) (5,2) (8,3) (6,4) (3,5) (7,6) (2,7) (4,8)
Q + + + + + + +
+ + + + + + Q +
+ + + + Q + + +
+ + + + + + + Q
+ Q + + + + + +
+ + + Q + + + +
+ + + + + Q + +
+ + Q + + + + +
-Write programs to solve the eight Queens chess problem: in 8 rows and 8 columns of placing 8 Queens on the Board, made it impossible for either a Queen eating other 7 Queen (Note: Queen may eat with her peers or other pieces on the same column, or diagonal), and the results are displayed in a certain way.
For example, when you find out a solution of the following, you can output the following message to indicate that the solution (the output display coordinate position of the Queen and "Checkerboard"-Board position of the Queen in a "Q" characters, other locations for the "+" character).
(1,1) (5,2) (8,3) (6,4) (3,5) (7,6) (2,7) (4,8)
Q+++++++
++++++ Q+
++++ Q+++
+++++++ Q
+ Q++++++
+++ Q++++
+++++ Q++
++ Q+++++
例如,当求出下述的一个解时,可输出如下信息来表示该解(输出了表示摆放皇后的坐标位置以及“棋盘状态”— 棋盘中有皇后的位置放一个“Q”字符,其他位置为“+”字符)。
(1,1) (5,2) (8,3) (6,4) (3,5) (7,6) (2,7) (4,8)
Q + + + + + + +
+ + + + + + Q +
+ + + + Q + + +
+ + + + + + + Q
+ Q + + + + + +
+ + + Q + + + +
+ + + + + Q + +
+ + Q + + + + +
-Write programs to solve the eight Queens chess problem: in 8 rows and 8 columns of placing 8 Queens on the Board, made it impossible for either a Queen eating other 7 Queen (Note: Queen may eat with her peers or other pieces on the same column, or diagonal), and the results are displayed in a certain way.
For example, when you find out a solution of the following, you can output the following message to indicate that the solution (the output display coordinate position of the Queen and "Checkerboard"-Board position of the Queen in a "Q" characters, other locations for the "+" character).
(1,1) (5,2) (8,3) (6,4) (3,5) (7,6) (2,7) (4,8)
Q+++++++
++++++ Q+
++++ Q+++
+++++++ Q
+ Q++++++
+++ Q++++
+++++ Q++
++ Q+++++
(系统自动生成,下载前可以参看下载内容)
下载文件列表
bahuanghou\bahuanghou.cpp
..........\bahuanghou.dsp
..........\bahuanghou.dsw
..........\bahuanghou.ncb
..........\bahuanghou.opt
..........\bahuanghou.plg
..........\Debug\bahuanghou.exe
..........\.....\bahuanghou.ilk
..........\.....\bahuanghou.obj
..........\.....\bahuanghou.pch
..........\.....\bahuanghou.pdb
..........\.....\vc60.idb
..........\.....\vc60.pdb
..........\Desktop_.ini
..........\Debug
bahuanghou
..........\bahuanghou.dsp
..........\bahuanghou.dsw
..........\bahuanghou.ncb
..........\bahuanghou.opt
..........\bahuanghou.plg
..........\Debug\bahuanghou.exe
..........\.....\bahuanghou.ilk
..........\.....\bahuanghou.obj
..........\.....\bahuanghou.pch
..........\.....\bahuanghou.pdb
..........\.....\vc60.idb
..........\.....\vc60.pdb
..........\Desktop_.ini
..........\Debug
bahuanghou