1个回答
2013-06-25
展开全部
窗体中放入Text控件和命令按钮.取text中的数字作为N代码如下Private Function F(n As Long) As Long
If n > 2 Then
F = F(n - 1) + F(n - 2)
Else
F = 1
End If
End FunctionPrivate Sub Command1_Click()
Cls
Dim I As Long
I = Val(Text1.Text)
Print "第" & I & "项:" & F(i)
End Sub
If n > 2 Then
F = F(n - 1) + F(n - 2)
Else
F = 1
End If
End FunctionPrivate Sub Command1_Click()
Cls
Dim I As Long
I = Val(Text1.Text)
Print "第" & I & "项:" & F(i)
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询