循环嵌套

乘法口诀表

	public static void main(String[] args) {
for(int x =1;x<10;x++) {
for(int y=1;y<=x;y++) {
System.out.print(x +"*"+y+"="+x*y+" ");
}
System.out.println();
}
}
>>>1*1=1
>>>2*1=2 2*2=4
>>>3*1=3 3*2=6 3*3=9
>>>4*1=4 4*2=8 4*3=12 4*4=16
>>>5*1=5 5*2=10 5*3=15 5*4=20 5*5=25
>>>6*1=6 6*2=12 6*3=18 6*4=24 6*5=30 6*6=36
>>>7*1=7 7*2=14 7*3=21 7*4=28 7*5=35 7*6=42 7*7=49
>>>8*1=8 8*2=16 8*3=24 8*4=32 8*5=40 8*6=48 8*7=56 8*8=64
>>>9*1=9 9*2=18 9*3=27 9*4=36 9*5=45 9*6=54 9*7=63 9*8=72 9*9=81

三角形

public static void main(String[] args) {
int line = 5;
for(int x=0;x<line;x++) {
for(int y=0;y<line-x;y++) {
System.out.print(" ");
}
for(int z=0;z<=x;z++) {
System.out.print("* ");
}
System.out.println();
}
} >>> *
>>> * *
>>> * * *
>>> * * * *
>>> * * * * *

最新文章

  1. caffe.exe (caffe.bin)用法回顾
  2. PHPcms 系统简单使用
  3. EntityFramework查询oracle数据库时报ora-12704: character set mismatch
  4. [2013 ACM/ICPC Asia Regional Nanjing Online C][hdu 4750]Count The Pairs(kruskal + 二分)
  5. angular调用WCF服务,读取文件夹下图片显示列表,下载另存为图片
  6. Java基础 -- 冒泡排序算法(带详细注释)
  7. 【QT相关】QT+opencv环境配置
  8. Error与Exception的区别
  9. python--对函数的理解
  10. 浅析Java中synchronized与static synchronized
  11. hdu 5667 BestCoder Round #80 矩阵快速幂
  12. 解决Spark On Yarn yarn-cluster模式下的No Suitable Driver问题
  13. 《Linux就该这么学》第十六天课程
  14. GitLab安装及使用
  15. Day15 Python基础之logging模块(十三)
  16. day31 网络编程,多进程多线程
  17. 跟随我在oracle学习php(9)
  18. 《高性能SQL调优精要与案例解析》新书样章
  19. sizeof(类)
  20. 理解lvalue和rvalue

热门文章

  1. 消息中间件技术 - 浅谈mqtt协议及其实现
  2. 2019 EIS高校安全运维赛 misc webshell
  3. Spring Boot框架 - 数据访问 - JDBC&amp;自动配置
  4. python中的while
  5. git拉取代码
  6. JSON parse error: default constructor not found. class java.time.YearMonth; nested exception is com.alibaba.fastjson.JSONException: default constructor not found. class java.time.YearMonth
  7. A. Angry Students
  8. mcast_get_loop函数
  9. JS中的提升(即变量和函数声明移动到代码顶部)
  10. django登陆界面报错InternalError at /admin/polls/question/add/