class Demo { public static void main(String[] args) { int[][] arr = new int[4][]; int num = 1; for (int i=0; i<arr.length; i++) { arr = new int[i+1]; for (int j=0; j<arr.length; j++) { arr[j] = num++; System.out.print(arr[j]); } System.out.println(); } } }
|