https://www.acmicpc.net/problem/2446
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=n;i>=1;i--){
for(int j=0;j<n-i;j++) System.out.print(" ");
for(int j=0;j<(i-1)*2+1;j++) System.out.print("*");
System.out.println();
}
for(int i=2;i<=n;i++){
for(int j=0;j<n-i;j++) System.out.print(" ");
for(int j=0;j<(i-1)*2+1;j++) System.out.print("*");
System.out.println();
}
}
}