/**
* @author Mxhlin
* @Email fuhua277@163.com
* @Date 2022/09/06/10:37
* @Version
* @Description 空心平行四边形
*/
public class PXSBXDemo {
public static void main(String[] args) {
int maxLine = 5;
for (int i = 1; i <= maxLine; i++) {
for (int j = 1; j <= maxLine-i ; j++) {
System.out.print(" ");
}
for (int j = 1; j <= 5; j++) {
if (i == 1 || i == maxLine ){
System.out.print("*");
}else if (j == 1 || j == 5 ){
System.out.print("*");
}else {
System.out.print(" ");
}
}
System.out.println();
}
}
}
标签:String,int,空心,Version,平行四边形,public
From: https://www.cnblogs.com/xhlin/p/16705557.html