文件名称:bahuanghouwenti
介绍说明--下载内容均来自于网络,请自行研究使用
描述:
输出8皇后问题所有结果。
输入:
没有输入。
输出:
每个结果第一行是No n:的形式,n表示输出的是第几个结果;下面8行,每行8个字符,‘A’表示皇后,‘.’表示空格。不同的结果中,先输出第一个皇后位置靠前的结果;第一个皇后位置相同,先输出第二个皇后位置靠前的结果;依次类推。
输入样例:
输出样例:
输出的前几行:
No 1:
A.......
....A...
.......A
.....A..
..A.....
......A.
.A......
...A....
No 2:
A.......
.....A..
.......A
..A.....
......A.
...A....
.A......
....A-Descr iption: Output 8-queens problem for all results. Input: no input. Output: the first line of each result is No n: the form, n is the first of several that the output results the following 8 lines of 8 characters, ' A' said the Queen, ' .' That space. Different results, the first output of the first Queen' s position toward the front of the results the same location the first queen, the first output of the second Queen' s position toward the front of the results and so on. Input sample: sample output: the output of the first few lines: No 1: A. ...... .... A. .. ....... A ..... A... . A. .... ...... A.. A. ..... ... A. ... No 2: A. ...... ..... A.. ....... A .. A. .... ...... A. ... A. .... A. ..... .... A. ..
输出8皇后问题所有结果。
输入:
没有输入。
输出:
每个结果第一行是No n:的形式,n表示输出的是第几个结果;下面8行,每行8个字符,‘A’表示皇后,‘.’表示空格。不同的结果中,先输出第一个皇后位置靠前的结果;第一个皇后位置相同,先输出第二个皇后位置靠前的结果;依次类推。
输入样例:
输出样例:
输出的前几行:
No 1:
A.......
....A...
.......A
.....A..
..A.....
......A.
.A......
...A....
No 2:
A.......
.....A..
.......A
..A.....
......A.
...A....
.A......
....A-Descr iption: Output 8-queens problem for all results. Input: no input. Output: the first line of each result is No n: the form, n is the first of several that the output results the following 8 lines of 8 characters, ' A' said the Queen, ' .' That space. Different results, the first output of the first Queen' s position toward the front of the results the same location the first queen, the first output of the second Queen' s position toward the front of the results and so on. Input sample: sample output: the output of the first few lines: No 1: A. ...... .... A. .. ....... A ..... A... . A. .... ...... A.. A. ..... ... A. ... No 2: A. ...... ..... A.. ....... A .. A. .... ...... A. ... A. .... A. ..... .... A. ..
(系统自动生成,下载前可以参看下载内容)
下载文件列表
bahuanghouwenti.cpp