题目内容 (请给出正确答案)
[主观题]

以下程序的输出结果为:public class test {public static void main(String args[]) {int s=0;

以下程序的输出结果为:

public class test {

public static void main(String args[]) {

int s=0;

for (int k=0;k<=10;k++)

s+=method(2,k)-1;

System.out.println(s);

}

public static int method(int n,int m) {

if (m==0)

return 1;

else

return n*method(n,m-1、;

}

}

A. 2048

B. 1024

C. 2036

D.2000

提问人:网友zhengyytt 发布时间:2022-01-07
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
更多“以下程序的输出结果为:public class test {…”相关的问题
第1题
public class Test { public static void main(String[] args) { int a=13; System.out.println(013); } } 程序的运行结果为:

A、11

B、013

C、13

D、011

点击查看答案
第2题
给定以下代码,程序的运行结果是 ()public class Test { public static void main(String[] args) { String result = reverse("happy"); System.out.println(result); } public static String reverse(String str) { StringBuilder result = new StringBuilder(""); char[] chArra = str.toCharArray(); for (int i = chArra.length - 1; i >= 0; i--) { char ch = chArra[i]; result.append(ch); } return result.toString(); } }
点击查看答案
第3题
下面程序片段的运行结果是?( ) public class Test { public static void main(String[] args){ String[] subs = "25.5\n\ts18.66segmentation19".split("\\D+"); double result = 0.0; for (int i=0; i<subs.length; i++) result +="Double.parseDouble(subs[i]);" system.out.println(result); }> A、133.0

B、123.0

C、63.16

D、63

点击查看答案
第4题
阅读下列程序,写出运行结果 public class Test{ public static void main(String[] args){ char x = ‘a’; char y = ‘c’; System.out.println(++x); System.out.println(y++); System.out.println(x – y); } }
点击查看答案
第5题
写出程序的运行结果 class Test5{ public static void main(String args[]) { int x = 5634; int s = 0; while (x>0) { s = s + x%10; x = x/10; } System.out.println("r="+s); } }
点击查看答案
第6题
public class test { public static void main(String args[]) { int i, s = 0; int a[] = { 10, 20, 30, 40, 50, 60, 70, 80, 90 }; for (i = 0; i < a.length; i++) if (a[i] % 3 == 0) s += a[i]; System.out.println(s); } } 执行结果: ________
点击查看答案
第7题
下列程序的输出结果是()。 Public class Test{ Public static void main(String[]args){ int[]array=(2,4,6,8,10); int size=6; int result=-l: try{ for(int i=0;i

A.Catch---1

B.Catch---2

C.Catch---3

D.以上都不对

点击查看答案
第8题
1. 下列程序运行的输出结果是________。 public class Test { public static void main(String[] args) { for(int i=1;i<=10;i++) { continue; system.out.print(i+" "); }> A、1 2 3 4

B、1 2 3 4 5 6 7 8 9 10

C、6 7 8 9

D、6 7 8 9 10

点击查看答案
第9题
以下程序的运行结果为 class test { public static void main(String args[]) { int x=2; System.out.printf("%d,%d,%d", x++ , x, ++x); } }

A、3,3,3

B、2,3,4

C、2,2,3

D、3,3,4

点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

为鼓励登录用户提交答案,简答题每个月将会抽取一批参与作答的用户给予奖励,具体奖励活动请关注官方微信公众号:简答题

简答题官方微信公众号

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
简答题
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反简答题购买须知被冻结。您可在“简答题”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
简答题
点击打开微信