代码如下
static int[][] array = {
{ 1, 1 },
{ 1, 0 }
};
static int d = 2;
public static void main(String[] args) {
int row = array.length;
int col = array[0].length;
******************************
row = col = 1;
for (int i = 0; i < row; i++) {
for (int j = 0; j < col; j++) {
int x = is_exist(i, j, d);
if (x == 1)
System.out.print("*");
else
System.out.print(" ");
}
System.out.print("\n");
}
}
public static int is_exist(int row, int col, int flag) {
if (flag == 0) {
******************************
} else if (is_exist(row, col, flag - 1) == 1) {
代码
} else {
******************************
}
}
问题1
补充完整********************代码
问题2
当D为3层时,第三行第五列单元格是由D=2时哪一个单元格转化来的