在窗体上画一个名称为CoilTlilandl的命令按钮,然后编写如下事件过程: Private Sub command1 Click() Dim m As Integer, i As Integer, x(3)As Integer For i=0 To 3:x(i)=i:Next i For i = 1 To 2: Call sub1(x,i):Next i For i = 0 To 3: Print x(i);: Next i End Sub Private Sub sub1(a()As Integer,k As Integer) Dim i As Integer Do a(k)=a(k)+a(k+1) j = j + 1 Loop While j < 2 End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是
A.0 3 7 5
B.0 1 2 3
C.3 2 4 5
D.0 5 8 3
第1题:
下列程序段的执行结果为 ______。 Dim m(3,3)As Integer Dim i As Integer Dim j As Integer Dim x As Integer For i=1 To 3 m(i,i)=i Next For i=0 To 3 For j=0 To 3 x=x+m(i,j) Next Next Print x
A.3
B.4
C.5
D.6
第2题:
在窗体上绘制一个命令按钮,其名称为Command1,然后编写如下事件过程:Private Sub Command1_Click() Dim i As Integer,x As Integer For i=1 To6 If i=1 Then x=i If i<= 4 Thenx=x+1 Elsex=x+2 End If Next i Print xEnd Sub 程序运行后,单击命令按钮,其输出结果为 。A.9 B.6 C.12 D.15
第3题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序: Option Base 1 Private Sub Command1_Click( ) Dim c As Integer,d As Integer d=0 c=6 x=Array(2,4,6,8,10,12) For i=1 TO 6 If x(i)>c Then d=d+x(i) c=x(i) Else d=d-c End lf Next i Print d End Sub 程序运行后,如果单击命令按钮,则在窗体上输出的内容为
A.10
B.16
C.12
D.20
第4题:
有如下函数过程: Function lj(x As Integer) As Long Dim s As Long Dim i As Integer s=0 For i = 1 To x s=s+ i Next i 1j= s End Function在窗体上添加一个命令按钮,名为Command1, 编写事件过程调用该函数: Private Sub Command1 Click() Dim i As Integer Dim sum As Long For i = 1 To 5 sum = sum + 1j(i) Next i Print sum End Sub
A. 25
B.35
C.45
D.55
第5题:
在窗体上绘制一个命令按钮,其名称为Command1,然后编写如下事件过程: Private Sub Command1 Click() Dim i As Integer, x As Integer For i=1 To 6 If i=1 Then x=i If i<= 4 Then x=x+1 Else x=x+2 End If Next i Print x End Sub 程序运行后,单击命令按钮,其输出结果为
A.9
B.6
C.12
D.15
第6题:
单击一次命令按钮之后,下更程序代码的执行结果为______ 。 Public Sub Proc(a() As Integer) Static i As Integer Do a(i) = a(i) + a(i + 1) i=i+1 Loop While i < 2 End Sub Private Sub Command1_Cliek() Dim m As Integer Dim i As Integer Dim x(10) As Integer For i = 0 To 4 x(i) = i + 1 Next i For i = 1 To 2 Call Proc (x) Next i For i = 0 To 4 Print x(i); Next i End Sub
A.3 4 7 5 6
B.3 5 7 4 5
C.1 2 3 4 5
D.1 2 3 5 7
第7题:
单击一次命令按钮后,下列程序的执行结果为
Private Sub Command1_Click()
Dim m As Integer,I As Integer,x(10) As Integer
For I=0 To 4:x(I)=I+1:Next I
For I=1 TO 2:Call Prioc(x):Next I
For I=0 TO 3:Print x(I);:Next I
End Sub
Private Sub Prioc(a()As Integer)
Static I As Integer
Do
a(I)=a(I)+a(I+1)
I=I+1
Loop While I<2
End Sub
A.3 4 7 5
B.3 5 7 4
C.1 2 3 4
D.1 2 3 5
第8题:
当Form_Click;事件发生时,窗体上显示的第三行是 ______。 Private Sub Form_Click() Dim i As Integer, j As Integer, k As Integer Dim x(5, 5) As Integer For i = 1 To 5 k = 1 For j = 1 To 5 If i <= j Then x(i, j) = k + 1 k=k+2 Else x(i, j) = k + 1 End If Next j Next i For i = 1 To 5 For j = 1 To 5 Print x(i, j) Next j Print Next i End Sub
A.22135
B.21357
C.22213
D.13579
第9题:
编写如下事件过程: Option Base 1 Private Sub Form Click() Dim x1()As Integer Dim i As Integer Dim s As Integer ReDim x1(3) For i = 1 To UBound(x1) x1(i)=i + 1 Next i Call sub1(x1) For i = 1 To UBound(x1) s = s + x1(i) Next i Print s End Sub Private Sub sub1(n()As Integer) Dim i As Integer ReDim Preserve n(5) For i = 3 To 5 n(i)=n(i-1)*2 Next i End Sub 程序运行后,单击窗体,则窗体上显示的内容是
A.6
B.12
C.24
D.47
第10题:
在窗体上添加如下命令按纽,然后编写如下事件过程: Private Sub Command1_Click() Dim a(10)As Integer Dim p(3)As Integer k= 5 For i = 1 To 10 a(i) = i Next i For i = 1 To 3 p(i) = a(i * i) Next i For i = 1 To 3 k = k + p(i) * 2 Next i Print k End Sub该过程的运行结果为______。
A.35
B.33
C.31
D.29
第11题:
在窗体上画一个命令按钮,然后编写如下程序: Option Base 1 Private Sub Command1 Click() Dim Arr1(12)As Integer, Arr2(3)As Integer Dim Sum As Integer Sum = 2 For i=1 To 12 Arrl(i)= i Next i For i=1 To 3 Arr2(i)= Arrl(i*i) Next i For i = 1 To 3 Sum = Sum + Arr2(i) Next i Print Sum End Sub 程序运行后,单击命令按钮,在窗体上的输出结果为
A.16
B.24
C.32
D.36
第12题:
下列程序段的执行结果为 ______。 Dim m(3,3)As Integer Dim i As Integer Dim j As Integer Dim K As Integer For i=1 To 3 m(i,i)=i Next For i=0 To 3 For j=0 To 3 x=x+m(i,j) Next Next Print x
A.3
B.4
C.5
D.6
第13题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序: Private Sub Command1 Click() Dim i As Integer,j As Integer Dim a(10,10)As Integer For i=1 To 3 For j=1 To 3 a(i,j)=(i-1)*3+j Print a(i,j); Next j Print Next i End Sub 程序运行后,单击命令按钮,窗体上显示的是______。
A.1 2 3 2 4 6 3 6 9
B.2 3 4 3 4 5 4 5 6
C.1 4 7 2 5 8 3 6 9
D.1 2 3 4 5 6 7 8 9
第14题:
设有如下通用过程: Public Sub Fun(a( )As Integer,x As Integer) For i=1 TO 5 x=x+a(i) Next End Sub 在窗体上画一个名称为Text1的文本框和一个名称为Command1的命令按钮。然后编写如下的事件过程: Private Sub Command1_Cliek( ) Dim arr(5) As Integer,n As Integer For i=1 To 5 arr(i)=i+i Next Fun arr,n Text1.Text=Str(n) End Sub 程序运行后,单击命令按钮,则在文本框中显示的内容是
A.30
B.25
C.20
D.15
第15题:
在窗体上画一个名称为 Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim a(4)As Integer, x As Integer, sum As Integer n = 4: sum = 0 a (1) = 1 For k = 0 To n - 1 For i = 1 To k + 1 x = k + 2 - i a(x)= a(x)+ a(x - 1) If x < n - k Then Exit For sum = sum + a(x) Next i Next k Print sum End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是
A.5
B.6
C.8
D.11
第16题:
在窗体上画一个命令按钮(其名称为Command1),然后编写如下事件过程: Private Sub Command1_Click() Dim a(5,5)As Integer Dim i As Integer,j As Integer For i=1 To 3 For j=1 To 3 a(i,j)=(i-1)*3+j Print a(i,j) Next j Print Next i End Sub 程序运行后,单击命令按钮,在窗体上的输出结果是: ______。
A.1 4 7 2 5 8 3 6 9
B.1 2 3 4 5 6 7 8 9
C.1 2 3 4 5 6 7 8 9
D.没有输出
第17题:
在窗体上绘制一个命令按钮,其名称为Command1,然后编写如下事件过程: Private Sub Command1_Click() Dim i As Integer,x As Integer For i_1 T0 6 If i=1 Then x=i If i<=4 Then x=x+1 Else x=x+2 End If Next i Print x End Sub 程序运行后,单击命令按钮,其输出结果为( )。
A.9
B.6
C.12
D.15
第18题:
在窗体上画一个名称为Labell的标签,然后编写如下事件过程。 Private Sub Form_Click( ) Dim arr(10, I0) As Integer Dim i As Integer, j As Integer For i = 2 To 4 For j =2 To 4 arr(i,j) =i*j Next Next Labell. Caption = Str(arr(2,2) + arr(3,3) ) End Sub 程序运行后,单击窗体,在标签中显示的内容是
A.12
B.13
C.14
D.15
第19题:
在窗体上画一个命令按钮,然后编写如下事件过程: Sub BTC(old Copy( ) As Integer,new Copy( ) As Integer) Dim i AS Integer For i=LBound(oldCopy( ))To UBound(oldCopy( )) newCopy(i)=oldCopy(i) Next i End Sub Private Sub Command1 _ Click( ) Dimm(10) As Integer,n(10)As Integer For i=1 To 10 m(i) =i*i Next i Call BTC(m,n) Print n(5) End Sub 程序运行后,单击命令按钮输出结果为
A.0
B.2
C.10
D.25
第20题:
程序代码如下,当单击窗体上的Command1控件时,在窗体上输出的结果是( )。 Private Sub Command1_Click() Dim aa(3,3)As Integer Dim i As Integer,j As Integer Dim s As Integer For i=0 To 3 For j=0 To 3 aa(i,j)=i*4+j+1 Next j Next i For i=0 To 3 s=s+aa(i,1) Next i Print s End Sub
A.32
B.28
C.30
D.36
第21题:
在窗体上画一个名称为Commandl的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim n As Integer For n = 0 To 9 Step 3 Print rel(n); Next n End Sub Private Function rel(ByVal i As Integer)As Integer Dim x As Integer x = 0 For j = 1 To i If i < 5 Then rel = i: EXit Function x = x + i Next i rel = x End Function 程序运行后,单击命令按钮,则窗体上显示的内容是
A.1 3 5 7
B.2 8 14 53
C.0 3 21 45
D.0 5 11 34
第22题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下通用过程和命令按钮的事件过程: Private Function fun(ByVal m As Integer) If m Mod 2=0 Then fun=2 Else fun=1 End If End Function Private Sub Command1_Click( ) Dim i As Integer,s As Integer S=0 For i=1 To 5 s=s+fun(i) Next Print 3 End Sub 程序运行后,单击命令按钮,在窗体上显示的是
A.6
B.7
C.8
D.9
第23题:
下列程序段的执行结果为______。 Dim m(3,3)As Integer Dim i As Integer Dim j As Integer Dim x As Integer For i=1 To 3 m(i,i)=i Next For i=0 T0 3 For j=0 To 3 x=x+m(i, j) Next Next Print x
A.3
B.4
C.5
D.6