Private Sub Form_Click()
Dim a As Integer, i As Integer, s As Long
s = 1
a = InputBox("请输入一个数", "提示", "5")
For i = 1 To a
s = s * i
If i = a Then
Print Str(i) + "=" + Str(s)
Else
Print Str(i) + "*";
End If
Next
End Sub
Private Sub Command1_Click()
n = CInt(InputBox("求N!,请输入N的值:"))
s = 1
For i = 2 To n
s = s * i
Next i
MsgBox ("N!=" & s)
End Sub