public class 魏功豪_test_continue {
public static void main(String[] args) {
int start = 1;
int end = 9;
for (int Counter = start; Counter <= end; Counter++) {
if (Counter % 2 == 1) {
for (int i = 1; i <= (end - Counter) / 2; i++) {
System.out.print(" ");
}
}
for (int i = 1; i <= Counter; i++) {
if (Counter % 2 == 0) {
continue;
}
System.out.print("*");
}
if (Counter % 2 == 0) {
System.out.print("\n");
}
}
}
}
沒有留言:
張貼留言