设有如下程序:
Private Sub Form. Click( )
Dim i As Integer,x As String,y As String
x="ABCDEFG"
For i=4 To 1Step-1
y=Mid(X,i,i)+y
Next i
Print y
End Sub
程序运行后,单击窗体,输出结果为( )。
A.ABCCDEDEFG
B.AABBCDEFG
C.ABCDEFG
D.AABBCCDDEEFFGG
第1题:
设有如下程序: 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.32
B.33
C.34
D.35
第2题:
单击命令按钮时,下列程序代码的执行结果为______。 Private Sub Proe1 (n As Integer,ByVa1 m As Integer) n=n Mod 10 m=m\ 10 End Sub Private Sub Command1_Click() Dim x As Integer Dim y As Integer x= 12 y = 34 Call Proe1 (x, y) Print x; y End Sub
A. 12 34
B.2 34
C.2 3
D.12 3
第3题:
设有如下程序:
Private Sub Form_Click()
Dim i As Integer,x As String,Y As String
x=”ABCDEFG”
For i=4 To 1 Step-1
y=Mid(x,i,i)+y
Next i
Print y
End Sub
程序运行后,单击窗体,输出结果为
A.ABCCDEDEFG
B.AABBCDEFG
C.ABCDEFG
D.AABBCCDDEEFFGG
第4题:
有如下程序: Private Sub Commandl_Click( ) Dim i As Integer For i=1 To 2 DS Next i End Sub Sub DS( ) Dim x As Integer,m As String Static y,n X=X + 1 y=y + 1 m=m &"*”:n=n&"#" Print x,y,m,n End Sub 程序运行后,输出的结果是
A.1 1 * #
B.1 1 * #
C.1 1 * # 1 1 * # 1 2 * #
D.1 1 * # 1 1 * ## 1 2 * ##
第5题:
设有如下程序: Private Sub Form. Click( ) Dim i As Integer,x As String,y As String x="ABCDEFG" For i=4 To 1Step-1 y=Mid(X,i,i)+y Next i Print y End Sub 程序运行后,单击窗体,输出结果为( )。
A.ABCCDEDEFG
B.AABBCDEFG
C.ABCDEFG
D.AABBCCDDEEFFGG
第6题:
在窗体上画一个命令按钮,然后编写如下程序 Private Sub Command4 Click() Dim a As Integer,b As Integer a=1 b=2 Print N(a,B)End Sub Function N(x As Integer,y As Integer)As Integer N=IIf(x>y,x,y) End Function 程序运行后,单击命令按钮,输出结果为
A.l
B.2
C.5
D.8
第7题:
下列程序的执行结果为 Private Sub Command1_Click Dim FirStr As String FirSt="abcdef" Print Pat(FirStr. End Sub Private Function Pat(xStr As String.As String Dim tempStr As String, strLen As Integer tempStr="" strLen=Len(xStr. i=1 Do While i<=Len(xStr.-3 tempStr=tempStr+Mid(xStr, i, 1)+Mid(xStr, strLen -i+1, 1) i=i+1 Loop Pat=tempStr End Function
A.abcdef
B.afbecd
C.fedcba
D.defabc
第8题:
下面程序: Private Sub Form. _Click () Dim x, y, z As Integer x=5 y=7 z=0 Call P1(x, y, z) Print Str (z) End Sub Sub P1 (ByVal a As Integer, ByVal b As Integer , c As Integer) c= a+b End Sub 运行后的输出结果为______。
A.0
B.12
C.Str(z)
D.显示错误信息
第9题:
Command1_Click()事件代码如下: Private Sub Command1_Click() Dim x As Integer, Y As Integer x = 6 : Y : 8 Call ABC(X, Y) Print X; Y End Sub Private Sub ABC(ByVal X As Integer,Y As Integer) X = X + 4 Y = Y = 2 End Sub 事件发生后,X和Y的值分别为 ______。
A.6, 8
B.10, 10
C.10, 8
D.6, 10
第10题:
有如下事件过程: Private Sub Commaild1_Click( ) Dim i As Integer For i =1 To 2 DC Next i End Sub Sub DC( ) Dim x As Integer,m As String Static y,n x=x + 1 y=y + 1 m=m&"*":n=n &"#" Print x,y,m,n End Sub 程序运行后,输出的结果是
A.1 1 * # 1 1 * #
B.1 1 * # 1 2 * #
C.1 1 * # 1 1 * ##
D.1 1 * # 1 2 * ##