ForForDemo
来源:互联网 发布:用友软件 主要客户 编辑:程序博客网 时间:2024/05/01 13:35
public class ForFor99Demo { public static void main(String[] args) { //九九乘法表 for(int x=1;x<=9;x++) { for(int y=1;y<=x;y++) { System.out.print(y+"x"+x+"="+x*y+"\t"); } System.out.println(); }// System.out.println("\\Hellow\tWorld\\"); /* * \n 回车键; * \t 制表符; * \b 退格; * \r 按下回车键 */ }}public class ForForDemo { public static void main(String[] args) { /* ***** ***** ***** ***** */// // for(int x=0;x<4;x++) { //外循环控制的是次数// for(int y=0;y<5;y++) { //内循环控制的是每一行的个数// System.out.print("*");// }// System.out.println();// }// for(int a=0;a<4;a++) { for(int b=0;b<5;b++) { System.out.print("*"); } System.out.println(); } }}public class ForForTest { public static void main(String[] args) { /* ***** **** *** ** * */ /* int z = 5 ; for(int x=1;x<=5;x++) { for(int y=1;y<=z;y++) { //1-5 1-4 1-3 1-2 System.out.print("*"); } System.out.println(); z-- ; } */ /* int z = 1 ; for(int x=1;x<=5;x++) { for(int y=z;y<=5;y++) { //1-5 2-5 3-5 4-5 System.out.print("*"); } System.out.println(); z++ ; } */ /* for(int x=5;x>=1;x--) { for(int y=1;y<=x;y++) { //1-5 2-5 3-5 4-5 System.out.print("*"); } System.out.println(); } */ for(int x=1;x<=5;x++) { for(int y=x;y<=5;y++) { //1-5 2-5 3-5 4-5 System.out.print("*"); } System.out.println(); } }}public class ForForTest2 { public static void main(String[] args) { /* * ** *** **** ***** */ for(int x=1;x<=5;x++) { for(int y=1;y<=x;y++) { System.out.print("*"); } System.out.println(); } System.out.println("------------------------------"); /* * 54321 * 5432 * 543 * 54 * 5 */ for(int x=1;x<=5;x++) { for(int y=5;y>=x;y--) { System.out.print(y); } System.out.println(); } System.out.println("------------------------------"); /* * 1 * 22 * 333 * 4444 * 55555 */ for(int x=1;x<=5;x++) { for(int y=1;y<=x;y++) { System.out.print(x); } System.out.println(); } }}public class ForForTest3 { public static void main(String[] args) { /* * * * * * -* * * * --* * * ---* * ----* */ for(int x=1;x<=5;x++) { for(int y=1;y<x;y++) { System.out.print(" "); } for(int z=x;z<=5;z++) { System.out.print("* "); } System.out.println(); } System.out.println("--------------------------------------"); /* ----* ---* * --* * * -* * * * * * * * * */ for(int x=1;x<=5;x++) { for(int y=4;y>=x;y--) { System.out.print(" "); } for(int z=1;z<=x;z++) { System.out.print("* "); } System.out.println(); } }}
0 0
- ForForDemo
- forforDemo.java
- 1129ForForDemo
- Day1之ForForDemo
- 有源蜂鸣器和无源蜂鸣器讲解
- Mesh网格篇(二)网格的快速切割
- iOS UIWebView 图片自适应屏幕宽度
- angular2 +Polymer 环境搭建
- 伪聊天室实现记录
- ForForDemo
- PCM到WAV的转换(java)
- jQuery父级以及同级元素查找介绍
- 微机个人笔记-中断
- CkEditor批量上传图片(java)
- 最简单的jquery插件开发示例
- Win2008 r2 iis7/iis7.5系统下HTTP重定向
- Android样式的开发:drawable汇总篇
- MongoDB的安装与部署