1d to 2d array
題目說明
請先設定以下一維陣列 int [] nums = {7,5,4,8,3,2,1,9};
輸入兩數m、n,將nums裡的數字依序放入m x n的二維陣列並輸出
若nums無法完整放入m x n的陣列則回傳 wrong!
輸入
m n
輸出
m x n矩陣
sample input1
2 4
sample output1
7 5 4 8
3 2 1 9
sample input2
3 3
sample output2
wrong!
Comments