public class Chart0505 {
//for打印三角形
public static void main(String[] args) {//直角三角形for (int i = 1; i <= 4; i++) {for (int j = 1; j <= i; 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 k = 1; k <= (2 * i - 1); k++) {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 k = 1; k <= i; k++) {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 k = 1; k <= i; k++) {System.out.print("* ");}System.out.println();
}
for (int i = 1; i <= 3; i++) {for (int j = 1; j <= i; j++) {System.out.print(" ");}for (int k = 1; k <= (4-i); k++) {System.out.print("* ");}System.out.println();
}
}
}