打印三角形
for (int x = 1; x <= 5; x++) {
for (int y = x; y < 5; y++) {
System.out.print(" ");
}
for (int z = 1; z <x*2; z++) {
System.out.print("*");
}
System.out.println();
}
打印三角形
for (int x = 1; x <= 5; x++) {
for (int y = x; y < 5; y++) {
System.out.print(" ");
}
for (int z = 1; z <x*2; z++) {
System.out.print("*");
}
System.out.println();
}