资 源 简 介
(九宫问题)在一个3×3的九宫中有1-8这8个数及一个空格随机的摆放在其中的格子里。现在要求实现这个问题:将该九宫格调整为如图1-1右图所示的形式。调整的规则是:每次只能将与空格(上、下、或左、右)相邻的一个数字平移到空格中。试编程实现这一问题的求解。 -----------VC完整应用程序代码-(JiuGongTu) in a 3 3 JiuGongTu are 1-8 this August and the number of a random display spaces in which the grid yard. Now demands of the problem : this Jiugongge adjusted to the squad as shown in Figure 1-1 forms. Adjusted rules : Each will only spaces (upper and lower, or left and right), a number of adjacent spaces- were moved. Test Programming Solution of this problem.----------- VC complete application code