@@ -0,0 +1,562 @@
+package array3;%0A%0Aimport java.util.Arrays;%0A%0Apublic class SquareUpTest %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%0A%09%09SquareUpTest test = new SquareUpTest();%0A%09%09System.out.println(Arrays.toString(test.squareUp(3)));%0A%09%09System.out.println(Arrays.toString(test.squareUp(2)));%0A%09%09System.out.println(Arrays.toString(test.squareUp(4)));%0A%09%7D%0A%0A%09public int%5B%5D squareUp(int n) %7B%0A%09%09// if (n == 0) return new int%5B%5D %7B%7D;%0A%0A%09%09int%5B%5D result = new int%5Bn * n%5D;%0A%0A%09%09for (int i = 1; i %3C= n; i++) %7B%0A%09%09%09for (int j = 1; j %3C= i; j++) %7B%0A%09%09%09%09result%5Bi * n - j%5D = j;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return result;%0A%09%7D%0A%7D%0A

Add SquareUpTest