package model;
public class Tree {
public static void main(String[] args) {
// TODO 自动生成的方法存根
//三角形
for (int i = 1; i <= 6; i++) {
for (int j = 1; j <= 6-i; j++) {
System.out.print(" ");
}
for (int j = 1; j <= 2*i-1; j++) {
System.out.print("*");
}
System.out.println();
}
//梯形
for (int i = 1; i <= 4; i++) {
for (int j = 1; j <= 4-i; j++) {
System.out.print(" ");
}
for (int j = 1; j <= 2*i+2; j++) {
System.out.print("*");
}
System.out.println();
}
//矩形
for (int i = 1; i <= 5; i++) {
System.out.print(" ");
for (int j = 0; j <= 5; j++) {
System.out.print("*");
}
System.out.println();
}
}
}
03-21
2560
12-20
2812