摘要:
递归的特点 终止条件:递归必须有一个终止的条件,即不能无限循环地调用本身。 自身调用:原问题可以分解为子问题,子问题和原问题的求解方法是一致的,即都是调用自身的同一个函数 public class T { public static void main(String[] args) { System 阅读全文
posted @ 2022-05-30 21:09
禁止摆烂
阅读(53)
评论(0)
推荐(0)
摘要:
package com.fh.bianMa.base; public class PrintTriangleTest { public static void main(String[] args) { for (int i = 1; i <= 5; i++) { for (int j = 5; j 阅读全文
posted @ 2022-05-30 18:00
禁止摆烂
阅读(22)
评论(0)
推荐(0)
摘要:
break:强制退出整个循环,不执行剩余的循环语句 continue:强制终止本次循环,继续执行剩余的循环语句 package com.fh.base; public class T { public static void main(String[] args) { for (int i = 0; 阅读全文
posted @ 2022-05-30 16:51
禁止摆烂
阅读(449)
评论(0)
推荐(0)
摘要:
/** * 用while或for循环1-1000之间能被5整除的数,并且每行输出3个 */ public class T { public static void main(String[] args) { m1(); } static void m2(){ for (int i = 0; i < 阅读全文
posted @ 2022-05-30 16:15
禁止摆烂
阅读(50)
评论(0)
推荐(0)
摘要:
package com.fh.base; public class WeiYunSuanFuTest { public static void main(String[] args) { int a = 10;//1010 int b = 8;//1000 System.out.println("a 阅读全文
posted @ 2022-05-30 10:51
禁止摆烂
阅读(163)
评论(0)
推荐(0)
摘要:
短路逻辑运算符 与 逻辑运算符 的区别是: 逻辑运算符:所有条件都执行一遍 短路逻辑运算符:一旦符合条件,立即终止 package com.fh.base; public class T { public static void main(String[] args) { int a = 3; in 阅读全文
posted @ 2022-05-30 09:57
禁止摆烂
阅读(484)
评论(0)
推荐(0)