下列程序段的执行结果为( )。 Dim m(10) For k = 1 To 10 m(k)= 11 - k Next k x = 5 Print m(2 + m(x))
查看答案
窗体上已有命令按钮Command1和标签Labe1,下列程序运行后,单击Command1按钮,标签Label1中显示的内容是( )。 Option base 0 Private Sub Command1_Click() Dim a(5)As Integer, n As Integer For i = 1 To 5 a(i)= i n = n + a(i) Next i Label1 = n End Sub
A. 10
B. 5
C. 程序报错,Label1不能输出结果
D. 15
下列程序段的执行结果为( )。 Dim A(10) As Integer,B(5) As Integer For I=1 To 10 A(I)=I Next I For J=1 To 5 B(J)=J*20 Next J A(5)=B(2) Print “A(5)=”;A(5)
A(5)=40
B. A(5)=5
C. A(5)=20
D. A(5)=10
设执行以下程序段时依次输入1,3,5,执行结果为( )。 Dim a(4) As Integer,b(4) As Integer For K=0 To 2 a(K+1)=Val(InputBox(“请输入数据:”)) b(3-K)=a(K+1) Next K Print b(K)
A. 0
B. 5
C. 3
D. 1
执行以下Command1的Click事件过程结果( )。 Option Base 0 Private Sub Command1_Click() Dim a a=Array(“a”,”b”,”c”,”d”,”e”,”f”,”g”) Print a(1);a(3);a(5) End Sub
A. abc
B. bdf
C. 出错
D. ace