java打印平行四边形
/*** java打印平行四边形*/
public class Test22 {public static void main(String[] args) {for (int i = 1; i < 6; i++) {for (int j = 1; j < 6 - i; j++) {System.out.print(" ");}for (int j = 1; j <= 6; j++) {System.out.print("*");}System.out.println();}}}
执行代码如下: