Private Sub Command1_Click()
Dim i, b As Integer
Dim a As Double
a = 1
For i = 1 To b
a = i * a
Next i
'a为b的阶乘
Text1.Text = a
End Sub
Private Sub Command1_Click()
Dim i%, n%, s&
s = 1
For i = 1 To 3
If CallByName(Me, "Option" & i, VbGet).Value Then n = i + 9: Exit For
Next
For i = 1 To n
s = s * i
Next
Text1 = s
End Sub
Dim n As Integer
Private Sub Command1_Click()
Dim i, t As Long
t = 1
For i = 1 To n
t = t * i
Next i
Text1.Text = t
End Sub
Private Sub Option1_Click()
n = 10
End Sub
Private Sub Option2_Click()
n = 11
End Sub
Private Sub Option3_Click()
n = 12
End Sub