文件名称:chess
介绍说明--下载内容均来自于网络,请自行研究使用
在N*N的棋盘上(1<=N<=10)填入1,2,...N*N共N*N个数,使得任意两个相邻的数之和为素数.输出满足条件的最小序列的方案。
最小序列即将每一行连接起来组成一行,然后使前面的尽可能小,当第一个数字相同时则比较下面一个,依次类推。
比如当N=2时,序列为1 2 4 3,当无满足条件的方案时输出"NO"。
-In the N* N chessboard (1 < = N < = 10) filled 1,2, ... N* N total number of N* N so that any two adjacent numbers and prime numbers. Output to meet the minimum conditions of the program sequence. The smallest sequence of each line will soon connect the composition of his party, and then in front of as small as possible so that, when the first phase at the same time the number is more of a following, and so on. For example, when N = 2, the sequence 1 2 4 3, when no program to meet the conditions of output " NO" .
最小序列即将每一行连接起来组成一行,然后使前面的尽可能小,当第一个数字相同时则比较下面一个,依次类推。
比如当N=2时,序列为1 2 4 3,当无满足条件的方案时输出"NO"。
-In the N* N chessboard (1 < = N < = 10) filled 1,2, ... N* N total number of N* N so that any two adjacent numbers and prime numbers. Output to meet the minimum conditions of the program sequence. The smallest sequence of each line will soon connect the composition of his party, and then in front of as small as possible so that, when the first phase at the same time the number is more of a following, and so on. For example, when N = 2, the sequence 1 2 4 3, when no program to meet the conditions of output " NO" .
(系统自动生成,下载前可以参看下载内容)
下载文件列表
chess.cpp