package com.sxt;
import java.util.Scanner;
public class gold {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("请输入金字塔层数");
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int i,j;
for(i = 1;i<=n;i++) //循环输出几层金字塔
{ // * 空格
for(j = n;j>=i;j--) {
System.out.print(" ");} // * 1 = 2*1-1 5
// *** 3 = 2*2-1 4
// ***** 5 = 2*3-1 3
// ******* 7 = 2*4-1 2
// ********* 9 = 2*5-1 1
for(j = 1;j<=i*2-1;j++) {
System.out.print("*");
}
System.out.print("\n");
}
}
}