Java 8*8空心矩阵代码(简化版):
package com.neusoft.test;
public class Test7 {
public static void main(String[] args){
int a=0;
while(a<8){
System.out.print("*");
a=a+1;
}
System.out.println();
int b=0;
while(b<6){
System.out.print("*");
int d=0;
while(d<6){
System.out.print(" ");
d=d+1;
}
System.out.println("*");
b=b+1;
}
int c=0;
while(c<8){
System.out.print("*");
c=c+1;
}
}
}
网友评论