https://www.acmicpc.net/problem/10992
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int n=s.nextInt();
for(int i=1;i<n;i++){
for(int j=n-i;j>0;j--) System.out.print(" ");
System.out.print("*");
for(int j=0;j<(i-2)*2+1;j++) System.out.print(" ");
if(i!=1) System.out.print("*");
System.out.println();
}
for(int i=0;i<(n-1)*2+1;i++) System.out.print("*");
}
}