for的图形练习与转义字符注意点
来源:互联网 发布:阿里云服务器 密钥 编辑:程序博客网 时间:2024/06/05 22:56
public class ForFor { public static void main(String[] args) { // TODO Auto-generated method stub /* ***** **** *** ** * for(int x=5; x>0; x--) { for(int y=x; y>0; y--) System.out.print("*"); System.out.println(); } */ /* * ** *** **** ***** for(int x=1; x<=5; x++) { for(int y=1; y<=x; y++) System.out.print("*"); System.out.println(); } */ /* 54321 5432 543 54 5 */ for(int x=0; x<5; x++) { for(int y=5; y>x; y--) System.out.print(y); 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(); } /* 1*1=1 1*2=2 2*2=4 1*3=3 2*3=6 3*3=9 .................... */ for(int x=1; x<=9; x++) { for(int y=1; y<=x; y++) System.out.print(y+"*"+x+"="+x*y+"\t"); System.out.println(); } /* \n:回车 \t:制表符 \b:退格 \r:按下回车键 1111111111111111111重要 windows系统中回车符是由两个符号组成 \r\n 在很多情况下 \n并不奏效 linux中回车符是 \n */ /* * * * * * * * * * * * * * * * 分析: 第一行 0空格 打印5个"* " 第二行 1空格 4个 第三行 2空格 3个 第四行 3空格 2个 第五行 4空格 1个 */ for(int x=1; x<=5; x++) { for(int z=0; z<x-1; z++) System.out.print(" "); for(int y=1; y<=6-x; y++) System.out.print("* "); System.out.println(); } }}
阅读全文
0 0
- for的图形练习与转义字符注意点
- XML注意的转义字符
- ORACLE转义字符的那点事
- ORACLE转义字符的那点事
- 练习转义字符
- for循环的注意点
- JAVA分割字符串的方法需要注意的!转义字符
- JAVA分割字符串的方法需要注意的!转义字符
- JAVA分割字符串的方法需要注意的!转义字符
- JAVA分割字符串的方法需要注意的!转义字符
- String.split()方法的注意点(转义符)
- c语言中的转义字符的应用注意
- 转义字符 /r与/n的区别
- java数据类型与转义字符的讲解
- 注意判断js中使用正则表达式的转义字符,到底是对谁进行转义!!!
- 特殊字符与转义
- 字符输入注意点
- 字符常量与转义字符
- badgeValue的设置和使用
- 七牛(7.0.3)工具类,java上传下载demo
- sonarqube中文插件安装
- MySQL常用命令 一
- Spring AOP运用---记录方法调用与结果日志
- for的图形练习与转义字符注意点
- ORACLE Scheduler特性(10)管理Chains
- 微信小程序 事件冒泡(十二)
- 质数中的质数(质数筛法)
- http 请求
- 数据库中事务的四大特性(ACID) and 事务的隔离级别。
- 交叉编译时候如何设置连接库的搜索路径
- Codeforces Round #426 (Div. 2) C. The Meaningless Game
- 选择排序