Output stars (*) according to the number of layers of stars_ Java version
•
Java
I looked at it myself and thought it was fun, so I wrote one myself
LAYERS = 10 String BLANK_1 = " " String START_1 = "*" showTa( (number >= 1 ( i = 1; i <= number; i++ System.out.println(getBlanks(number - i) + getStars(2 * i - 1 } System.out.println("你输入的数[" + number + "]不在处理的范围中,请输入大于或等于1的数" String getBlanks( StringBuffer blanks = ( i = 0; i < length; i++ String getStars( StringBuffer blanks = ( i = 0; i < length; i++ }
<div class="cnblogs_code">
LAYERS = 10 String BLANK_1 = " " String START_1 = "*"