【发布时间】:2020-10-27 13:14:42
【问题描述】:
所以我想知道如何制作这个......
我在互联网上找到了这个代码,它给了我一个数字正方形图案
import java.util.Scanner;
public class Square {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a;
System.out.print("Input :");
a = sc.nextInt();
for (int iOuter = 1; iOuter <= a; iOuter++) {
for (int i = 1; i <= a; i++) {
System.out.print(i);
}
System.out.println();
}
}
}
如果我输入 5,这是输出
12345
12345
12345
12345
12345
我正在寻找这个输出
12345
54321
12345
54321
12345
提前致谢
【问题讨论】:
-
除了您的要求外,还请说明您的问题。您尝试了哪些解决方案?为什么它们不起作用?