阅读下面的程序,填写程序中缺少的部分,并把程序的输出结果写出来;
classTest{
staticvoidShowArrayInfo(int[]student){
for(inti=0;i
Console.Write(student[i]++);
Console.Write(“”);
}
}
staticvoidMain(){
int[]student=newint[]{1,2,3,4,5};
ShowArrayInfo(student);
Console.Write(“/n”);
ShowArrayInfo(student);
}
}
输出结果:
阅读以下程序,填写运行结果()。 def f1(m): s=0 for i in str(m): s+=int(i) return s def f2(n): s=0 while n>0: s=s+1 n=n//10 return s print(f1(123)//f2(123))
A.上述三个a方法是方法重载
B.上述三个a方法是方法重写
C.上面代码编译通不过
D.上述三个方法是第一个和第二个a方法是方法的重写,第三个a方法编译会有问题
A.9
B.5
C.6
D.6.1
A.234
B.246
C.567
D.356
A.null
B.有错误,变量i没有初始化
C.1
D.0
阅读以下程序,给出运行结果。
classA{
publicstaticvoidmain(Stringargs[]){
intj=0;
for(inti=1;i<=10;i++){
j=j+i;
}
System.out.println("j="+j);
}
}
运行结果是:
A.8
B.2
C.6
D.4