计算n的阶乘 vb程序代码
计算n的阶乘 vb程序代码
日期:2017-11-27 06:11:36 人气:1
Private Sub Command1_Click()
Dim fac As Double, n As Integer, i As Integer
fac = 1
n = CInt(InputBox("请输入要计算阶乘的数N:"))
If n < 0 Then MsgBox "N不能小于0!": Exit Sub
For i = 2 To n
fac = fac * i
Next i
MsgBox n & "!=" &