package com.bdqn.yingyun; |
import java.util.Scanner; |
public class DaojinZiTa { |
public static void main(String[] args) { |
System.out.println( "请输入倒金字塔的行数:" ); |
@SuppressWarnings ( "resource" ) |
Scanner sca = new Scanner(System.in); |
int n = sca.nextInt(); |
for ( int i = n; i >= 1 ; i--) { |
for ( int j = 1 ; j <= n - i; j++) { |
System.out.print( " " ); |
} |
for ( int k = 1 ; k <= 2 * i - 1 ; k++) { |
System.out.print( "*" ); |
} |
System.out.println(); |
} |
} |
} |