Private Sub Command1_Click()
n = Val(Text1.Text)
s = 1
If n = 0 Then
s = 1
Else
For i = 1 To n
s = s * i
Next i
End If
If n <> Int(n) Then
s = "输入错误"
Else
s = Str(s)
End If
Text2.Text = s
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End Sub
Private Sub Command3_Click()
End
End Sub
在输入18以上的时候阶乘值不对~~~