文件名称:queen
介绍说明--下载内容均来自于网络,请自行研究使用
在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
【输入格式】
输入: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