网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
运行下列程序,单击窗体后显示结果为()。 Private Sub Form_Click() Dim k As Integer For k = 1 To 2 Print "3" + k; "3" & k; Spc(3); Next End Sub
A.31 31 4 31
B.31 31 32 32
C.4 31 5 32
D.32 32 5 32
参考答案和解析
33
更多 “运行下列程序,单击窗体后显示结果为()。 Private Sub Form_Click() Dim k As Integer For k = 1 To 2 Print "3" + k; "3" k; Spc(3); Next End SubA.31 31 4 31B.31 31 32 32C.4 31 5 32D.32 32 5 32” 相关考题
考题
在窗体上画一个命令按钮,名称为Command1,然后编写如下代码: Option Base() Private Sub Command1 Click() Dim A(4)As Integer,B(4)As Integer For k=0 To 2 A(k+1)=InputBox(“请输入一个整数”) B(3-k)=A(k+1) Next k Print B(k) End sub 程序运行后,单击命令按钮,在输入对话框中分别输入2、4、6,输出结果为______。A.0B.2C.3D.4
考题
下面程序:________Option Base 1Private Sub Command1_Click() Dim a(10),p(3)As Integer Dim i,k As Integer k=5 For i=1 To 10 a(i)=i Next For i=1 To 3 p(i)=a(i*i) Next For i=1 To 3 k=k+p(i)*2 Next Print kEnd Sub运行后的输出结果为________。A.33B.28C.35D.37
考题
下列程序 Option Base 1 Const upl = 10 Private Sub Form_click() Dim a(upl) As Integer k = -1 For i = 1 To upl a(i) = i * k k = -1 * k Next i For i = 1 To 10 Print a(i); Next End Sub 运行时输出的结果是 () 。
A. 1 3 5 7 9 10B. -1 -3 -5 -7 -9C. -1 2 -3 4 -5 6 -7 8 -9 10D. 1 -2 3 -4 5 -6 7 -8 9 -10
考题
在窗体上画一个名称为Labell的标签,然后编写如下事件过程: Option Base 1 Private Sub Form_Click() Dim a(20) As Integer For k=1 To 20 a(k)=k^2 Next k Label1.Caption=a(k) End Sub 程序运行后,单击窗体,在标签中显示的内容是 ______。A.400B.20C.441D.出错信息
考题
设有如下程序: 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
考题
当Form1_Click事件发生时,窗体上显示的第三行是( )。 Option Base 1 Private Sub Form_Click() Dim i As Integer,j As Integer Dim k As Integer,a(5,5)As Integer For i=1 To 5 k=1 For j=1 To 5 If i<=j Then a(i,j)=k k=k+1 Else a(i,j)=1 End If Next j Next i For i=1 To 5 For j=1 To 5 Print a(i,j); Next j Print Next i End SubA.1 2 3 4 5B.1 1 2 3 4C.1 1 1 2 3D.1 1 1 1 2
考题
编写如下事件过程: Private Sub Form_Click() k=2 Ifk>=1 Then A=3 Ifk>=2 Then A=2 Ifk>=3 Then A=1 Print A End Sub 程序运行后,单击窗体,输出的结果为 ______。A.1B.2C.3D.出错
考题
某个窗体己编写以下事件过程。打开窗体运行后,单击窗体,消息框的输出结果为【 】。Private Sub Form_Click()Dim k as Integer, n as Integer,m as Integern=10 :m=1 : k=1Do While k<=nm=m*2k=k+1LoopMsgBox mEnd Sub
考题
阅读下列程序: Private Sub Command1_Click( ) Dim i As Integer,k As Integer k=2 For i=1 To 3 Print H(k); Next i End Sub Function H(j As Integer) a=0 Static b a=a+1 b=b+1 H=a*b+j End Function 程序运行后,单击命令按钮输出结果是A.234B.345C.567D.356
考题
阅读下列程序。Option Base 1Private Sub Form CliCk()Dim x(3,3)For j=1 to 3For k=1 to 3If j=k then x(j,k)=1If j<> k then x(j,k)=3Next kNext jCall fun(x())End SubPrivate Sub fun(a())For j=1 to 3For k=1 to 3Print a (j,k);Next kNext jEnd Sub运行程序时,输出的结果是【 】。
考题
阅读下列程序。Option Base 1Private Sub Form. _Click()Dim x(3,3)For j=1 to 3For k=l to 3If j=k then x(j,k)=1If j<>k then x(j,k)=kNext kNext iCall fun(x())End SubPrivate Sub fun(x())For j=1 to 3For k=1 to 3Print x(j,k);Next kNext jEnd Sub运行程序时,输出结果为【 】。
考题
在窗体上画一个名称为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
考题
为某个窗体编写如下事件,单击窗体,消息框显示的结果为【 】。Private Sub Form_Click( )Dim k As Integer ,n As Integer ,m As Integern=10:m=1:k=1Do While k<=nm=m*2k=k+1LoopMsgBox mEnd Sub
考题
以下程序运行后输出的结果是 ______。 Option Base 1 Private Sub Form_Click() Dim A(20) For K=1 To 20 A(K)=K^2 Next K Print A(K) End SubA.20B.441C.400D.出错信息
考题
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序 _______。 Dim k As Integer Private Sub Form_Load() k=5 End Sub Private Sub Command Click() Static b As Integer b = b + k k=k+1 Print k,b End Sub 程序运行时,两次单击命令按钮Command1后,在窗体上显示的第二行是 _______。A.7 11B.5 11C.76D.2 1
考题
阅读下列程序: Private Sub Command1_Click() Dim i As Integer, k As Integer k=2 For i=1 To 3 Print H(k); Next i End Sub Function H(j As Integer) Static b a=0 a=a+1 b=b+1 H=a*b+jEnd Function单击命令按钮,执行程序,输出结果是( )。A.2 3 4B.3 4 5C.5 6 7D.3 5 6
考题
当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 SubA.22135B.21357C.22213D.13579
考题
若有如下程序: Private Sub Command1_Click() Dim i As Integer, k As Integer k=2 For i = 1 To 3 Print H(k); Next i End Sub Function H(j As Integer) Static b a=0 a=a+1 b=b+1 H=a*b+j End Function 单击命令按钮,执行程序,输出结果是( )。A.2 3 4B.3 4 5C.5 6 7D.3 5 6
考题
下面程序运行后的结果是( )。 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
考题
窗体上有一个名为Command1的命令按钮,并有下面的程序: Private Sub Command1 Click( ) Dim arr(5)As Integer . For k=1 To 5 art(k)=k Next k prog art( ) For k=1 T0 5 Print art(k); Next k End Sub Sub prog(a( )As Integer) n=UBound(a) For i=n To 2 step-1 if a(j)a(j十1)Then t=a(j):a(1)=a(j+1);a(j+1)=t End If Next j Next i End Sub 程序运行时,单击命令按钮后显示的是( )。A.12345B.54321C.01234D.43210
考题
在窗体上画一个命令按钮,名称为Command1,然后编写如下代码: Option Base 0 Private Sub Command1_Click() Dim Al(4) As Integer, A2(4) As Integer For k = 0 To 2 A1(k + 1) = InputBox (“请输入1个整数”) A2(3 - k) = A1(k + 1) Next k Print A2(k) End Sub程序运行后,单击命令按钮,在输入对话框中依次输入2、4、6,输出结果为______。A.1B.2C.3D.4
考题
在窗体上添加如下命令按纽,然后编写如下事件过程: 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.35B.33C.31D.29
考题
在窗体上画一个名为Command1的命令按钮,然后编写以下程序:Private Sub Command1 Click( ) Dim a(10)As Integer Fork=10 To 1 Step-1 a(k)=20-2*k Next k k=k+7 Print a(k-a(k)) End Sub 运行程序,单击命令按钮,输出结果是( )。A.18B.12C.8D.6
考题
在窗体上画一个命令按钮,名称为Command1,然后编写下列代码: Option Base 0 Private Sub Command1 Click( ) Dim A1(4)As Integer,A2(4)As Integer For k=0 To 2 A1(k+1)=InputBox(”请输入一个整数”) A2(3-k)=A1(k+1) Next k Print A2(k) End Sub 程序运行后,单击命令按钮,在输入对话框中依次输入2、4、6,则输出结果为( )。A.0B.1C.2D.3
考题
当发生Form_Click事件时,窗体上显示的第三行是( )。 Option Base 1 Private Sub Form_Click() Dim i As Integer,j As Integer,k As Integer Dim a(5,5)As Integer For i=1 To 5 k=1 For i=1 To 5 If(i<=j)Then a(i,j)=k k=k+2 Else a(i,j)=k+1 End If Next j Next i For i=1 To 5 For j=1 To 5 Print a(i,j); Next j Print Next i End SubA.1 3 5 7 9B.2 1 3 5 7C.2 2 2 1 3D.2 2 1 3 5
考题
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序: Dim k As Integer Private Sub Form_Load() k=15 End Sub Private Sub Command1_Click() Static b As Integer b=b+k k=k+1 Print k,b End Sub 程序运行时,两次单击命令按钮Command1后,在窗体上显示的第二行是( )。A.17 31B.15 31C.17 16D.2 1
考题
执行下面的程序,单击窗体后窗体消息框内显示结果是( )。 PRIVATE SUB FORM_CLICK() DIM STR AS STRING, K AS INTEGER STR="AB" FOR K = LEN(STR) TO 1 STEP -1 STR=STRCHR(ASC(MID(STR, K, 1)) +K) NEXT K MSGBOX STR END SUBA.ABCEB.ABCDC.ABDBD.ABFB
考题
阅读下列程序: Private Sub Command1_Click() Dim i As Integer, k As Integer k=2 For i=1 To 3 Print H(k); Next i End Sub Function H(j As Integer) Static b a=0 a=a+r b=b+1 H=a*b+j End Function 单击命令按钮,执行程序,输出结果是( )。A.2 3 4B.3 4 5C.5 6 7D.3 5 6
热门标签
最新试卷