2024-11-06 10:02:04
public class Test940 {
public static void main(String[] args) {
fx(5);
}
private static void fx(int n) {
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
if (j == 1) {
System.out.print(String.format("%02d ", i * i));
} else if (i == 1 || i <= j) {
System.out.print(String.format("%02d ", (j - 1) * (j - 1) + i));
} else {
System.out.print(String.format("%02d ", i * i - j + 1));
}
}
System.out.println();
}
}
}
2024-11-06 09:04:34