package pattern;
public class Pattern2 {
public static void main(String[] args) {
int n = 7;
int r = n/2;
for (int i = 1; i <= n; i++) {
if(i<=r) {
for (int j = 1; j <=r-i+1; j++) {
System.out.print("* ");
}
for (int j = 1; j <= 2 * i - 1; j++) {
System.out.print(" ");
}
for (int j = 1; j <=r-i+1; j++) {
System.out.print("* ");
}
System.out.println();
}else if(i==r+1) {
System.out.println();
}
else {
for(int j = 1 ; j<=i-n+r ; j++) {
System.out.print("* ");
}
for(int j=1 ; j<=r+2-i; j++ ) {
System.out.print(" ");
}
for(int j =1 ; j<=i-n+r; j++) {
System.out.print("* ");
}
System.out.println();
}
}
}
}