java打印等腰梯形
/*** java打印等腰梯形*/
public class Test23 {public static void main(String[] args) {for (int i = 5;i<10;i++){for (int j = 0;j<10-i;j++){System.out.print(" ");}for (int j = 0;j<(i+1)*2-1;j++){System.out.print("*");}System.out.println();}}
}
执行代码如下: