for循环语句输出菱形
2015-10-04 20:44
260 查看
for(int a = 5; a > 0 ; a--){ for(int b = 1; b <= a; b++){ System.out.print(" "); } for(int c = 5; c >= a; c--){ System.out.print("* "); } System.out.println(" "); } for(int a = 4; a > 0 ; a--){ for(int d = 1; d > 0; d--){ //这行for循环只是为了排版用的,实际意义不大 System.out.print(" "); } for(int b = 4; b >= a; b--){ System.out.print(" "); } for(int c = 1; c <= a; c++){ System.out.print("* "); } System.out.println(""); }
相关文章推荐
- iOS常用UI控件熟悉
- ListView解决图片错乱为什弱引用相关比findViewWithTag效率要高?
- Uvalive 6264 Conservation 拓扑排序
- 软件测试基础总结
- 【设计模式】Template Method模式
- shell练习题讲解
- HDU 5467
- 整理介绍一些技术书籍(应届生求职必备)
- 2015年福州大学第12届程序设计大赛题解
- android开发学习笔记——权限
- kafka入门介绍
- html: Table合并行和列
- DBCP连接池配置参数说明
- 素性测试
- 气象数据格式
- autojump的安装和简单使用(环境:ubuntu14.04)
- 放松完毕回来准备继续...
- html: Table标签的初步使用
- J2EE中关于tomcat的maxIdle、maxActive、maxActive相关配置
- CSDN首页刊发对我的专访:我为什么要选择Rust?