queen
所属分类:数学计算
开发工具:MultiPlatform
文件大小:1KB
下载次数:1
上传日期:2016-05-19 16:47:16
上 传 者:
yhzq
说明: 在N*N的棋盘上放置N个皇后(n<=10)而彼此不受攻击(即在棋盘的任一行,任一列和任一对角线上不能放置2个皇后),编程求解所有的摆放方法。
【输入格式】
输入:n
【输出格式】
每行输出一种方案,每种方案顺序输出皇后所在的列号,各个数之间有空格隔开。若无方案,则输出no solute!
【输入样例】Queen.in
4
【输出样例】Queen.out
2 4 1 3
3 1 4 2
(Placed on the board of N* N N queens (n <= 10) and another against attack (ie any row of the board, and any one of any of a diagonal line can not be placed on the two queens), programmed to solve all display methods.
[Input Format
Input: n
[Output format]
Each line of output a scheme where each program sequentially output Queen column number, there are separated by a space between each number. Without the program, the output no solute!
[Sample input] Queen.in
4
Sample [output] Queen.out
2413
3142)
文件列表:
queen.cpp (1297, 2016-05-18)
近期下载者:
相关文件:
收藏者: