public class h04 {
public static void main (String[] args) {
int Line = 5;
for (int i = 1; i <= Line; i++) {
for (int j = 1; j <= Line - i; j++) {
System.out.print(" ");
}
for (int k = 1; k <= (i * 2) - 1; k++) {
System.out.print("*");
}
System.out.println("");
}
}
}
沒有留言:
張貼留言