网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

设有如下程序: Private Sub Form_ Click() Dim a Dim i As Integer, j As Integer a = Array(1, 2, 3, 4, 5, 6, 7, 8, 9) For i = 0 To 3 Print a(5 - i) Next End Sub程序运行后,单击窗体,则在窗体上显示的是______。。

A.4 3 2 1

B.5 4 3 2

C.6 5 4 3

D.7 6 5 4


参考答案

更多 “ 设有如下程序: Private Sub Form_ Click() Dim a Dim i As Integer, j As Integer a = Array(1, 2, 3, 4, 5, 6, 7, 8, 9) For i = 0 To 3 Print a(5 - i) Next End Sub程序运行后,单击窗体,则在窗体上显示的是______。。A.4 3 2 1B.5 4 3 2C.6 5 4 3D.7 6 5 4 ” 相关考题
考题 在窗体上画一个名称为Labell的标签,然后编写如下事件过程: Private Sub Form_Click() Dim arr(10,10)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 j Next i Labell.Caption=Str(arr(2,2)+arr(3,3)) End Sub 程序运行后,单击窗体,在标签中显示的内容是A. 12B.13C.14D.15

考题 设有如下程序:Private Sub Form_Click()Dim i As Integer,x As String,Y As Stringx=”ABCDEFG”For i=4 To 1 Step-1y=Mid(x,i,i)+yNext iPrint yEnd Sub程序运行后,单击窗体,输出结果为A.ABCCDEDEFGB.AABBCDEFGC.ABCDEFGD.AABBCCDDEEFFGG

考题 在窗体上绘制一个名称为Label1的标签,然后编写如下事件过程: Private Sub Form_Click() Dim arr(10,10)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 j Next i Label1.Caption=Str(arr(2,2)+arr(3,3)) End Sub 程序运行后,单击窗体,在标签中显示的内容是( )。A.12B.13C.14D.15

考题 在窗体上画一个名称为Text1 的文本框和一个名称为Command1 的命令按钮,然后编写如下事件过程: Private Sub Commandl1_Click( ) Dim array1 ( 10, 10) As Integer Dim i,j As Integer For i=1 To 3 For j = 2 To 4 Array1 (i, j) =i +j Next j Next i Text1.Text=array1(2.3) + array1(3.4) End Sub程序运行后,单击命令按钮,在文本框中为示的值是( )。A.12B.13C.14D.15

考题 设有如下程序: Private Sub Form. Click( ) Dim s As Long,f As Long Dim n As Integer,i As Integer f=1 n=4 For i=1 To n f=f*i s=s+f Next i Print s End Sub 程序运行后,单击窗体,输出结果是( )。A.32B.33C.34D.35

考题 有如下程序: Private Sub Command1_Click() Dim k As Integer,m As Integer Dim p As Integer k=4:m=1 p=PC(k,m):Print p; p=PC(k,m):Print p End Sub Private Function PC(a As Integer,b As Integer) Static m As Integer,i As Integer m=0:i=2 i=i + m + 1 m=i + a + b PC=m End Function 程序运行后,输出的结果为A.4 6B.6 6C.8 8D.10 12

考题 在窗体上画一个名称为Text1的文本框和一个名称为Commsnd1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click( ) Dim arrayl(10, 10) As Integer Dim i, j as Integer For i = 1 To 3 For j = 2 To 4 arrayl(i, j) = i+j Next j Next i Text11.. Text=array1(2, 3) + array1(3, 4) End Sub程序运行后,单击命令按钮,在文本框中显示的值是( )。A.12B.13C.14D.15

考题 设有如下程序: Private Static Function Fac(n As Integer)As Integer Dim f As Integer f=f+n Fac=f End Function Private Sub Form_Click( ) Dim I As Integer For 1=2 To 3 Print"#";I“=”Fac(1) Next I End Sub 程序运行后,单击窗体,在窗体上显示的是A.#2=2 #3=3B.#2=2 #3=5C.#;2=2 #;3=3D.#;2=2 #3;=5

考题 下列程序共执行了______次循环。Private Sub Command1_ Click () Dim intsum As Integer Dim i AS Integer Dim j As Integer i = 1 j = 1 do do intsum = intsum + j =j+2 Print j; Loop until j >3 i = i+1 Loop until i>17 Print Print intsumEnd SubA.14B.15C.14D.13

考题 设有如下程序: Option Base 1 Private Sub Command1 Click() Dim a(10) As Integer Dim n As Integer n=InputBox(“输入数据”) If n< 10 Then Call,GetArray(a, n) End If End Sub Private Sub GetArray(b() As Integer, n As Integer) Dim c(10)As Integer j=0 For i=1 To n b(i)=CInt(Rnd()*100) If b(i) /2 =b(i) \2 Then j=j + 1 c(j) = b(i) End If Next Print j End Sub 以下叙述中错误的是A.数组b中的偶数被保存在数组c中B.程序运行结束时,在窗体上显示的是c数组中元素的个数C.GetArray过程的参数n是按值传送的D.如果输入的数据大于10,则窗体上不显示任何信息

考题 以下有关数组定义的语句序列中,错误的是 ______。A.Static arrl(3) arrl(1)=100 arrl(2)="Hello" arrl(3)123.45B.Dim arr2()As Integer Dim size As Integer Private Sub Command2_click() size=InputBox("输入:") ReDimarr2(size) End SubC.Option Base1 Private Sub Command3_click() Dim arr3(3)As Integer End SubD.Dim n As Integer Private Sub Command4_Click() Dim arr4(n)As Integer End Sub

考题 有如下程序: Private Sub Command1_Click() Dim k As Integer,m As Integer Dim op As Integer k=4:m=1 p=PPC(k,m):Print op; p=PPC(k.m):Print op End Sub Private Function PPC(a As Integer,b As Integer) Static m As Integer,i As Integer m=0:i=2 i=i+m+1 m=i+a+b PPC=m End Function 程序运行后,输出的结果为A.4 6B.6 6C.8 8D.10 12

考题 设有如下程序: Private Sub search(a()As Variant,ByVal key As Variant,index%) Dim I% For I = Lbound(a)To Ubound(A)If key=a(I)Then index=I Exit Sub End If Next I index=-1 End Sub Private Sub Form_Load() Show Dim b()As Variant Dim n As Integer b=Array(21,64,92,15,72,38,45,72) Call search(b, 45, n) Print n End Sub 程序运行后,输出的结果是A.2B.6C.10D.12

考题 阅读程序: Option Base 1 Dim art()As Integer Private Sub Form_Click() Dim i As Integer,j As Integer ReDim arr(3,2) For i=1 To 3 For j=1 To 2 arr(i,j)=i*2+j Next Next ReDim Preserve ale(3,4) For j=3 To 4 arr(3,j)=j+9 Next Print arr(3,2)+arr(3,4) End Sub 程序运行后,单击窗体,输出结果为A.21B.13C.8D.25

考题 设有如下程序: Option Base 0 Private Sub Form Click() Dim a Dim i As Integer a = Array(1, 2, 3, 4, 5, 6, 7, 8, 9) For i = 0 To 3 Print a(5 - i); Next End Sub 程序运行后,单击窗体,则在窗体上显示的是A.4 3 21B.543 2C.6 54 3D.7 6 54

考题 在窗体上画一个名称为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 5B.0 1 2 3C.3 2 4 5D.0 5 8 3

考题 有过程如下:Sub fact (m As Integer, total As Long) Dim i As Integer total = 1 for i = 1 To m total = total*i Next iEnd Sub调用它的事件过程如下:Private Sub Command1_ Click () Dim tot As Long Dim a As Integer a = Val InputBox (“请输入数据”)) Call fact (a, tot) Print totEnd Sub则输入数据5,运行结果为 ______。A.100B.120C.200D.50

考题 在窗体上画一个名称为Text1的文本框和一个名称为Commandl的命令按钮,然后编写如下事件过程: Private Sub Commandl Click() Dim arrayl(10,10)As Integer Dim i As Integer,j As Integer For i=1 To 3 For j=2 To 4 array l(i,j)=i+j Next j Next i Text1.Text=arrayl(2,3)+arrayl(3,4) End Sub 程序运行后,单击命令按钮,在文本框中显示的值是______。A. 12B.13C.14D.15

考题 在窗体上画一个名称为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.12B.13C.14D.15

考题 在窗体上绘制一个名称为Labell的标签,然后编写如下事件过程: Private Sub Form_Click() Dim arr(10,10)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 i Next i Labell.Caption=Str(arr(2,2)+arr(3,3)) End Sub 程序运行后,单击窗体,在标签中显示的内容是A.12B.13C.14D.15

考题 程序代码如下,当单击窗体上的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 SubA.32B.28C.30D.36

考题 编写如下事件过程: 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.6B.12C.24D.47

考题 阅读程序: Option Base 1 Dim arr() As Integer Private Sub Form. Click() Dim i As Integer,i As Integer ReDim arr(3,2) For i=1 To 3 For j=1 To 2 arr(i,j)=i*2+j Next j Next i ReDim arr(3,2)+arr(3,4) End Sub 程序运行后,单击窗体,输出结果为A.21B.13C.8D.25

考题 下面程序运行后的结果是( )。 Private Sub Form_Click() Dim s As Integer,k As Integer,i As Integer,n As Integer s=1 fori=1 to 3 forj=i to 3 for k=j to istep-1 s=s*k nextk,J,i print s End SubA.6B.72C.144D.432

考题 在窗体上画一个名称为Text1的文本框和一个名称为Command1的命令按钮,然后编写.如下事件过程: Private Sub Command1_Click() Dim array1(10,10)As Integer Dim i As Integer, j As Integer For i=1 To 3 For j=2 To 4 array1(i,j)=i+j Next j Next i Text1.Text=array1(2,3)+arrayl(3,4) End Sub 程序运行后,单击命令按钮,在文本框中显示的值是______。A.12B.13C.14D.15

考题 设有如下程序: Private Sub Form. Click( ) Dim ary(1 To 5)As Integer Dim i As Integer Dim sum As Integer For i=1 To 5 ary(i)=i+l sum=sum+ary(i) Next i Print sum End Sub 程序运行后,单击窗体,则在窗体上显示的是( )。A.15B.16C.20D.25

考题 下列程序打印结果为 ______。Private Sub Command1_ Click() Dim a(5)As String Dim b As Integer Dim i As Integer for i = 0 To 5 a(i)= i +1 Print a(i); Next iEnd SubA.12345B.6C.1 2 3 4 5 6D.0