广东北电面试题
-
[10-15 19:48:03] 来源:http://www.dxs56.com 面试技巧 阅读:8377次
概要:}Ansewr:Y,当i=0时可结束递归static int f(int i){ if(i==0){return 1;} else {return f(i-1)*f(i-2);}}Ansewr:N,因为i=1时,f(i-2)=f(-1),进入一个无限递归中b. There are two errors in the following JAVA program:static void g(int i){ if(i==1){return;} if(i%2==0){g(i/2);return;} else {g(3*i);return;}}please correct them to make sure we can get the printed-out result as below:3 10 5 16 8 4 2 1答:在第一个if语句前加System.out.print(i+" "); 本文章更多内容:1 - - - - - - - - - - - - 上一页 [1] [2]
广东北电面试题,标签:公务员面试技巧,面试的技巧,http://www.dxs56.com
}
Ansewr:Y,当i=0时可结束递归
static int f(int i){
if(i==0){return 1;}
else {return f(i-1)*f(i-2);}
}
Ansewr:N,因为i=1时,f(i-2)=f(-1),进入一个无限递归中本文章更多内容:1 - - - - - - - - - - - -
}
Ansewr:Y,当i=0时可结束递归
static int f(int i){
if(i==0){return 1;}
else {return f(i-1)*f(i-2);}
}
Ansewr:N,因为i=1时,f(i-2)=f(-1),进入一个无限递归中
b. There are two errors in the following JAVA program:
static void g(int i){
if(i==1){return;}
if(i%2==0){g(i/2);return;}
else {g(3*i);return;}
}
please correct them to make sure we can get the printed-out result as below:
3 10 5 16 8 4 2 1
答:在第一个if语句前加 System.out.print(i+" ");
Tag:面试技巧,公务员面试技巧,面试的技巧,求职就业指导 - 面试技巧
- 上一篇:百度baidu面试试题
最新更新
推荐热门
- · 招聘单位不解风情?学生情侣求职
- · 八大技巧帮助你面试成功
- · 最与众不同的面试方式
- · 求职者面试注意事项
- · 客服面试问题
- · 面试时身体语言的30种信号
- · 大学生村官面试技巧
- · 大学生就业面试要领
- · 面试中应聘者切忌“套熟”
- · 可反问面试官的问题