public class P9 {
public static void main(String[] args) {
int n = 8;
int nsp=n/2;
int nst=1;
int row=1;
while(row<=n) {
for(int csp=1; csp<=nsp;csp++) {
System.out.print(" ");
}
for(int cst=1; cst<=nst;cst++) {
System.out.print("* ");
}
for(int csp=1; csp<=nsp;csp++) {
System.out.print(" ");
}
System.out.println();
if(row<=n/2) {
nsp--;
nst+=2;
}else {
nsp++;
nst-=2;
}
row++;
}
}
}