追问
嗯,谢谢,最后的编写程序就是这个吗
追答是的,界面添加一个文本框,一个按钮就可以运行,语句测试过。
Private Sub Command1_Click()
Dim i As Integer, n As Integer, s As Double
s = 1
n = Val(Text1.Text)
If n <= 1 Then
Text2.Text = "1"
Exit Sub
Else
For i = 1 To n
s = s * i
Next i
Text2.Text = Format(s, "0")
End If
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Command1.Caption = "计算"
End Sub
追问嗯,这就是问题答案吗
可是这是要写阶乘呀
谢谢,能给我解释下吗
本回答被网友采纳