阅读下面的程序:public class test {public static void main(String args[]) {int i;float f = 2.3f;double d = 2.7;i = ((int)Math.ceil(f)) * ((int)Math.round(d));System.out.println(i);}} 程序执行后,运行结果为以下哪个选项?()
A.9
B.5
C.6
D.6.1
A.9
B.5
C.6
D.6.1
第1题
第2题
阅读下面的程序段: publiC class Sun { public static void main (String args[ ]) { int a=0; for(int i=1;i<=3;i++) { for(int j=1;j<=i;j++) { for(int k=j;k<=3;k++) { a=a+1; } } } System.out.println(A) ; } } 执行上面的3重循环后,a的值为()。
A.3
B.9
C.14
D.21
第3题
A.可以编译通过
B.不能编译通过
第4题
阅读下面的程序: public class Person{ int arr[ ]=Hew int[10]; public static void main(String args[ ]){ System.out.println(arr[1]); } } 正确的说法是______。
A.编译时将产生错误
B.编译时正确,运行时将产生错误
C.输出为0
D.输出为空
第5题
阅读下面的程序段: public class Sun { public static void main(String args[ ]) { int a=0 for(int i=1;i<=3;i++) { for(int j=1;j<-i;j++) { for(int k=j;k<=3;k++) { a=a+1; } } } System.out.println(A) 我; }}执行上面的3重循环后,a的值为()。
A.3
B.9
C.14
D.21
第6题
第7题
A.0
B.1
C.无结果
D.编译失败
第8题
A.0
B.1
C.无结果
D.编译失败
第9题
A.0
B.1
C.无结果
D.编译失败
第10题
A.0
B.1
C.无结果
D.编译失败
为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!