private int[][][] puzzleBoard = new int[][][] {
{ {5,3,0, 0,7,0, 0,0,0},
{6,0,0, 1,9,5, 0,0,0},
{0,9,8, 0,0,0, 0,6,0},
{8,0,0, 0,6,0, 0,0,3},
{4,0,0, 8,0,3, 0,0,1},
{7,0,0, 0,2,0, 0,0,6},
{0,6,0, 0,0,0, 2,8,0},
{0,0,0, 4,1,9, 0,0,5},
{0,0,0, 0,8,0, 0,7,9},
}
};
public void printArray() {
for (int a = 0; a < 9; a++){
for (int b = 0; b < 9; b++){
System.out.print(Arrays.toString(puzzleBoard[a][b]));
System.out.println();
}
}
}
我需要幫助改變這個數組,這樣它就會像數獨拼圖一樣打印出來。請幫幫我!努力打印出一個3d陣列
你在那裏有一個真正的二維數組,已被嵌入(不必要地)在另一個數組中。 –
我該如何解決這個問題? –