学学习网 手机版

学学习网

学习路径: 学习首页 > 应用开发 > java >

第四节 流程控制(5)

设置字体:
----------------------------------

                             {
                               System.out.print(" ");
                             }
                            //打印*
                            for (j=1;j<i;j++)
                                {
                                 //判断该层是否是顶层或者是底层
                                 If (i==1||i==lay ){
                                      System.out.println("*");
                                     } else {
                                             //如果是第一个或者最后一个打*
                                             If (j==1||j==(i-1)*2+1){
                                                      System.out.print(”*”);}else {System.out.print(” ”);}
                                             }
                                }
                        }
                     }
                 }
----------------------------------
课程列表
重点难点
赞助链接