上一页 1 ··· 38 39 40 41 42 43 44 45 46 ··· 60 下一页
摘要: int x=1; y=x++; 先备份,再加加,将备份的1赋值 y=++x; 先加加,再赋值 x=x++; 先备份,再加加,将备份的1赋值 阅读全文
posted @ 2022-06-14 23:15 开源遗迹 阅读(28) 评论(0) 推荐(0)
摘要: import java.util.Arrays; public class A6 { public static void main(String args[]) { int[] a= {3,7,5,2,0}; System.out.println(Arrays.toString(a)); sort 阅读全文
posted @ 2022-06-14 23:08 开源遗迹 阅读(26) 评论(0) 推荐(0)
摘要: 对一棵二叉树进行后序遍历,其输出结果为A,B,C,这样的二叉树有几颗? A:3 B: 4 C: 5 D: 6 首先后序遍历是:左——右——根 正常:c根a左b右 不正常:c根——没有右 / 没有左 B是A根节点 答案是c 阅读全文
posted @ 2022-06-13 23:46 开源遗迹 阅读(20) 评论(0) 推荐(0)
摘要: public class A5 { public static void main(String args[]) { System.out.println(f("asdf",3)); } public static String f(String s,int i) { if(i==0) return 阅读全文
posted @ 2022-06-13 23:07 开源遗迹 阅读(24) 评论(0) 推荐(0)
摘要: 题目: 2个double的变量x,y; x=2,y=x+3/2; a: 3.5 b: 3 c: 2.0 d: 3.0 public static void main(String args[]) { double x=2; double y=x+3/2; System.out.println(y); 阅读全文
posted @ 2022-06-13 22:40 开源遗迹 阅读(23) 评论(0) 推荐(0)
摘要: public class A3 { public static void main (String args[]) { int N=5; for(int n=0;n<=N;n++) { int s=f(n); System.out.println(n+"的阶乘:"+s); } } public st 阅读全文
posted @ 2022-06-13 22:28 开源遗迹 阅读(33) 评论(0) 推荐(0)
摘要: 位运算& 3 >00000011 5 >00000101 3&5? 00000011 & 00000101 00000001=1 阅读全文
posted @ 2022-06-13 11:24 开源遗迹 阅读(20) 评论(0) 推荐(0)
摘要: public static void main(String args[]){ int s=f(105,42); System.out.println(s); } public static int f(int x ,int y){ if(y==0) return x; else return f( 阅读全文
posted @ 2022-06-13 10:46 开源遗迹 阅读(28) 评论(0) 推荐(0)
摘要: 关于数字除以0的问题 public class Demo5 {public static void main (String args[]) { System.out.println(5.0/0.0); //Infinity无穷大的,这是错误,堆栈溢出 System.out.println(5.0/ 阅读全文
posted @ 2022-06-13 00:49 开源遗迹 阅读(19) 评论(0) 推荐(0)
摘要: // 计算3个A,2个B可以组成多少排列? public static void main(String args []){ int s=f(3,2); System.out.println(s); } public static int f(int m,int n){ if(m==0||n==0) 阅读全文
posted @ 2022-06-13 00:19 开源遗迹 阅读(24) 评论(0) 推荐(0)
上一页 1 ··· 38 39 40 41 42 43 44 45 46 ··· 60 下一页