package com.song.struct;
public class TestDemo {
public static void main(String[] args) {
//打印三角形 5行
for (int i = 1; i <= 5; i++) { //控制在五行
for (int j = 5;j>=i ; j--){
System.out.print(" ");
}
for (int j = 1; j <=i ; j++){
System.out.print("*");
}
for (int j = 1; j < i; j++){
System.out.print("*");
}
System.out.println();
}
}
}
struct Test study Hard
最新推荐文章于 2022-04-22 23:09:11 发布