展开全部
Function GetStr(ByVal i As Integer) As String '取得字符串
If i = 1 Then
GetStr = 1
Else
GetStr = GetStr(i - 1) & i
End If
End Function
Private Sub Command1_Click() '调用输出
Me.AutoRedraw = True
Dim n As Integer
n = Val(InputBox("请输入一个大于0的数值", "输入"))
If n > 0 Then
For i = 1 To n
Print GetStr(i)
Next
Else
MsgBox "输入的数值无效"
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询