在控制台上打印以下图案的 Java 程序

2025 年 3 月 17 日 | 阅读 1 分钟
Java program to print the following pattern on the console

算法

  • 步骤 1: 开始
  • 步骤 2: 定义 i, j
  • 步骤 3: 设置 n=6
  • 步骤 4: 设置 i=n。重复步骤 5 到步骤 7,直到 i>0。
  • 步骤 5: 设置 j=0。重复步骤 6,直到 j
  • 步骤 6: 打印 * 并设置 j=j+1
  • 步骤 7: 打印 "" 并设置 i=i-1。
  • 步骤8: 结束

程序

输出

Java program to print the following pattern on the console
下一个主题Java 程序