执行下面程序,单击命令按钮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
执行下面程序,单击命令按钮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
执行下面程序,单击命令按钮CmdRun后,图片框Pic1第一行显示内容是(),第二行显示内容是(),最后一行显示内容是()。
Option Explicit
Private Sub CmdRun_Click( )
Dim N As Integer,M As Integer
M=135
N=8
Pic1.Print Fun(M,N)
EndSub
Private Function Fun(ByVal N As Integer,ByVal R As Integer)As String
Dim L As Integer
If N
Fun=N
Else
L=N/R
Fun=Fun(L,R)
Fun=Fun & N Mod R
End If
Pic1.Print N
End Function
我来回答: