下面程序计算并输出的是( )。 Private Sub Command1 Click( ) a=10 s=0 Do s=s+a*a*a a=a-1 Loop Until a<=0 Print s End Sub
A.13+23+33+…+103的值
B.10!+…+3!+2!+1!的值
C.(1+2+3+…+10)3的值
D.10个103的和
第1题:
在窗体上添加一个命令按纽,名为command1,其事件过程如下,程序运行后,其输出的结果为______ 。 Private sub_command1_ click () Dim a a=array(1,2,3,4,5) For k=1 to 4 S=s+ a(k) Next k Print s End sub
A.10
B.14
C.15
D.120
第2题:
下面程序的输出结果是( )。 public class Sun { public static void main(String args[]) { int[]a={1,2,3,4}; int j=1,s=0; for(int i=3;i>=0;i--) { s=s+a[i]*j; j=j*10; } System.out.println(s); } }
A.1234
B.21
C.43
D.4321
第3题:
8、下面程序的输出结果是 。 #include<stdio.h> int main() { int k=1,s=0; do { if((k%2)!=0)continue; s+=k;k++; }while(k>10); printf("%d",s); return 0; }
第4题:
下面程序的输出结果是( )。 public class Sun { public static void main(String args[]) { int[] a={1,2,3,4); int j=1,s=0; for(int i=3;i>=0;i--) { s=s+a[i]*j; j=j*10; } System.out.println(s); } }
A.1234
B.21
C.43
D.4321
第5题:
在窗体上画一个命令按钮(其NAME属性为Command1),然后编写如下代码:
Option Base 1
Private Sub Command1_Click()
Dim a
s = 0
a = Array(1,2,3,4)
j = 1
For i = 4 To 1 Step -1
s = s + a(i) * j
j = j * 10
Next i
Print s
End Sub
运行上面的程序,单击命令按钮,其输出结果是( )。
A.4321
B.1234
C.34
D.12