阅读程序,选择输出结果publicclassArrayTest3{publicstaticvoidmain(String[]args){int[][]a=n
阅读程序,选择输出结果publicclassArrayTest3{publicstaticvoidmain(String[]args){int[][]a=newint[5][5];System.out.println(a);}}
A、0000
B、.00
C、0
D、0000000000000000
D、不能编译通过
阅读程序,选择输出结果publicclassArrayTest3{publicstaticvoidmain(String[]args){int[][]a=newint[5][5];System.out.println(a);}}
A、0000
B、.00
C、0
D、0000000000000000
D、不能编译通过
A.2 4 6 8
B.5 6 7 8
C.10 12 14 16
D.程序有错
3.阅读程序 (4)请说出E 类中【代码 1】和【代码 2】的输出结果。 class A { double f(int x,double y) { return x+y; } int f(int x,int y) { return x*y; } } public class E { public static void main(String args[]) { A a=new A(); System.out.println(a.f(10,10)); //【代码1】 System.out.println(a.f(10,10.0)); //【代码2】 } }
阅读程序,给出结果。
public class Fibonacci{
public static void main(String args[]){
System.out.println("fib(4)="+fib(4));
}
static int fib(int n){
if(n==0 | | n==1) {
return n;
}
else {
int sum=fib(n-1)+fib(n-2);
return sum;
}
}
}
输出结果为:______
A.p[4]引用格式错误,不能输出
B.输出值不定
C.输出68
D.输出0
阅读程序段,当输入数据形式为25,13,10时,正确的输出结果为 ______。 int x, y, z; cin>>x>>y>>z;; cout<< "x+y+z=%d\n" <<x+y+z;
A.x+y+z=48
B.x+y+z=35
C.x+z=35
D.不确定值
阅读程序,给出结果。
//Sum.Java源代码
public class Sum {
public static void main(String[]args){
int j=10;
System.out.println("j is:"+j);
calculate(j);
System.out.println("At last,j is:"+j);
}
static void calculate(int j)
{
for (int i=0;i<10;i++)
j++;
System.out.println("j in calculate() is: "+j);
}
}
输出结果为:
j is:(______)
j in calculate() is :(______)
At last j is : (______)
1. 选择结构程序设计的特点是 。 A. 自上向下逐个执行 B. 根据判断条件,选择其中一个分支执行 C. 反复执行某些程序代码 D. 以上都是 2. 逻辑运算符中,运算优先级按从高到低依次为 。 A. &&,!,|| B. ||,&&,! C. &&,||,! D. !,&&,|| 3.下列各语句序列中,能够且仅输出整型变量a、b 中最大值的是 。 A. if(a>b) printf("%d\n",a); printf("%d\n",b); B. printf("%d\n",b); if(a>b) printf("%d\n",a); C. if(a>b) printf("%d\n",a); else printf("%d\n",b); D. if(a<b) printf("%d\n",a); printf("%d\n",b); 阅读程序,写出运行结果 4. void main () { int a="10," b="4," c="3;" printf("%d, %d, %d\n", a, b, c) } 输出: 5. main() s="1,k=0;" switch (s) case 1: k+="1;" break; 2: default: printf(“%d”,k);>
阅读程序: Option Base 1 Private Sub Form_Click() Dim arr,Sum Sum=0 arr=Array(1,3,5,7,9,11,13,15,17,19) For i=1 To 10 If arr(i)/3=arr(i)\3 Then Sum=Sum+arr(i) End If Next i Print Sum End Sub程序运行后,单击窗体,输出结果为
A.13
B.14
C.27
D.15
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!