文件名称:8queen
- 所属分类:
- 棋牌游戏
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 1kb
- 下载次数:
- 0次
- 提 供 者:
- Fayer *******
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
在一个8×8国际象棋盘上,有8个皇后,每个皇后占一格;要求皇后间不会出现相互"攻击"的现象,即不能有两个皇后处在同一行、同一列或同一对角线上。问共有多少种不同的方法。
本算法采用一维数组来进行处理。数组的下标i表示棋盘上的第i列,a[i]的值表示皇后在第i列所放的位置。如:a[1]=5,表示在棋盘的第一例的第五行放一个皇后。-8 × 8 in a chess set, there s eight, each accounting for a Queen s grid request will not be any mutual between Queen s attack phenomenon, that can not have two Queen s in the same line, the same row or the same diagonal. Asked the total number of different ways. This algorithm uses one-dimensional array to be processed. Array subscr ipt i said i chessboard first out, a [i] value that s in the first place i listed by location. Such as: a [1] = 5, said the first cases in the chessboard of the fifth line of a Queen s release.
本算法采用一维数组来进行处理。数组的下标i表示棋盘上的第i列,a[i]的值表示皇后在第i列所放的位置。如:a[1]=5,表示在棋盘的第一例的第五行放一个皇后。-8 × 8 in a chess set, there s eight, each accounting for a Queen s grid request will not be any mutual between Queen s attack phenomenon, that can not have two Queen s in the same line, the same row or the same diagonal. Asked the total number of different ways. This algorithm uses one-dimensional array to be processed. Array subscr ipt i said i chessboard first out, a [i] value that s in the first place i listed by location. Such as: a [1] = 5, said the first cases in the chessboard of the fifth line of a Queen s release.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
8queen.c