用*号打印正方形

 


package
com.Summer_0416.cn; /** * @author Summer * 外层for执行一次,内层执行全部 */ public class Test_Method04 { public static void main(String[] args) { for (int i = 0; i < 5; i++) {//外层for执行 1,1,1,1 for (int j = 0; j < 5 ; j++) {//内层for执行4,4,4,4 System.out.print(" *");//加个空格才能形成正方形 } System.out.println(" "); } } }

 

相关文章:

  • 2021-11-14
  • 2022-12-23
  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2021-10-17
  • 2022-12-23
猜你喜欢
  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2021-06-30
相关资源
相似解决方案