[第3天] 程序的控制结构——循环嵌套例题05

来源:互联网 发布:派爱充值系统源码 编辑:程序博客网 时间:2024/05/20 05:28

【整理来源】黑马毕老师的java基础视频

例题:

----*

---* *

--* * *

_* * * *

* * * * *

<pre name="code" class="java">class ForForTest5{public static void main(String[] args) {for(int x=0; x<5; x++)<span style="white-space:pre">  //{ for(int y=x; y<5; y++)//尖向下  y=x{System.out.print("-");}for(int z=0; z<=x; z++)<span style="white-space:pre"></span> //* ,尖向上,{System.out.print("* ");}System.out.println();}}}


0 0