public static void main(String[] args) {
int row = 10;
row = (row / 2) * 2 + 1;
for (int i = 0; i < row; i++) {
if (row / 2 + 1 > i) {
for (int j = 0; j < row - i; j++) {
System.out.print(" ");
}
for (int j = 0; j < i + 1; j++) {
System.out.print("* ");
}
} else {
for (int j = 0; j < i + 1; j++) {
System.out.print(" ");
}
for (int j = 0; j < row - i; j++) {
System.out.print("* ");
}
}
System.out.println();
}
}
*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * *
* * * *
* * *
* *
*
|