Private Sub Form_Click()
Dim n As Integer, t#, i%
n = InputBox("输入正整数", "阶乘")
t = 1
i = 1
Do While i <= n
t = t * i
i = i + 1
Loop
Print n & "!=" & t
End Sub
放一个text1,一个label1,一个command1
private sub command1_click()
dim k as integer
k=1
for i=1 to val(text1.text)
k=k*i
next i
label1.caption=k
end sub