您的位置:首页 > 其它

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

2014-11-02 20:13 351 查看
【整理来源】黑马毕老师的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();
}
}
}



                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: