等腰三角形
import java.util.Scanner;
public class BalanceTriangle {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
System.out.println(“请输入层数:”);
int n=in.nextInt();
for(int i=1;i<n+1;i++) {
for(int j=1;j<n-i+1;j++) {
System.out.print(" “);
}
for(int j=1;j<i+1;j++) {
System.out.print(”*"+" ");
}
System.out.println();
}
in.close();
}
}