4*4正方形

package java04_循环结构;

  • 44正方形
    public class 练习5 {
    public static void main(String[] args) {
    for(int i = 1;i<=4;i++){
    for(int j = 1;j<=4;j++){
    System.out.print("
    ");
    }
    System.out.println();
    }

for(int i = 1;i<=10;i++){
for(int j = 1;j<=i;j++){
System.out.print("*");
}
System.out.println();
}
}
}

猜你喜欢

转载自blog.csdn.net/qq_40661543/article/details/113932702