运行下面的程序,单击Cmd1,窗体上显示的第一行是(),第二行是() ,最后一行是()。
Option Explicit
Private Sub Cmd1_Click( )
Dim A As Integer
A=3
Call Sub1(A)
Print A
End Sub
Private Sub Sub1(X As Integer)
X=X*2+1
If X<10 Then
Call Sub1(X)
End If
X=X*2+1
Print X
End Sub
执行下面的程序,单击command1,窗体上显示的第一行是(),第二行是(),第四行是(),最后一行是()
Option Explicit
Private Sub Command1_Click( )
Dim n As Integer
n=5
Call test(n)
Print n
End Sub
Private Sub test(ByVal n As Integer)
Dim i As Integer,S As String
If n>0 Then
For i=l To n
S=S & CStr(i)
Next i
Print S
Call test(n-2)
Else
Print "0VER"
EndIf
EndSub
执行下面程序,单击命令按钮Command1,窗体上显示的第一行内容是(),第二行内容是(),第三行内容是().
Option Explicit
Private Sub Command1_Click( )
Dim a As Integer, b As Integer, i As Integer
a = 1
b = 5
For i = b To a Step -1
a = a + i
b = b + a
If b > 30 Then Exit For
Print a, b
Next i
Print a, b
End Sub
执行下面程序,单击命令按钮Cmd1后,窗体上显示的第一行内容是(),第二行内容是(),第三行内容是()。
Option Explicit
Private Sub Cmd1_Click( )
Dim st As String,ch As String*1,t As Integer
Dim i As Integer
st="2,3,8,12,32,65#"
For i=1 To Len(st)
ch=Mid(st,i,1)
If ch<>"," And ch<>"#" Then
t=t*10+Val(ch)
Else
If pd(t) Then Print t
t=0
End If
Next i
End Sub
Private Function pd(ByVal n As Integer)As Boolean
Do While n<>1
If n Mod 2<>0 Then
Exit Function
EndIf
n=n/2
Loop
pd=True
End Function
执行下面程序,单击按钮CmdRun,窗体上显示的第一行结果是(),UBound(a)的值为(),其中a(1)的值为().
Option Explicit
Private Sub CmdRun_Click( )
Dim St As String,i As Integer
Dim a( ) As String,j As Integer,k As Integer
St="abcd"
Call Sub1(St)
Print St
For i=1 To Len(St)
For j=i+1 To Len(St)
If Mid(St,i,1)=Mid(St,j,1) Then Exit For
Next j
If j>Len(St) Then
k=k+1
ReDim Preserve a(k)
a(k)=Mid(St,i,1)
Print "a(";k;")=";a(k)
End If
Next i
End Sub
Private Sub Sub1(S As String)
Dim i As Integer
For i=1 To Len(S)/2
Mid(S,i,1)=Mid(S,Len(S)-i+1,1)
Next i
End Sub
运行下面程序,单击CmdRun,在窗体上显示a的值是();b的值是();i的值是()。
Option Explicit
Private Sub CmdRun_Click( )
Dim i As Integer,a As Integer,b As Integer
a=1:b=10
For i=a To b Step a+1
a=a+1
b=b+1
i=i+1
Next i
Print a,b,i
End Sub
运行下面的程序,单击commandl,在窗体上显示的变量A的值为(),变量B的值为()
Option Explicit
Dim A As Integer
Private Sub Command1_Click( )
Dim B As Integer
B=3
A=4
B=Fun(Fun(A,B+2),A)+B
Print A,B
EndSub
Private Function Fun(N As Integer,K As Integer)
N=N+A
K=N-K
Fun=N+K+A
End Function
我来回答: