Private Sub Form_Click()
Dim i As long, C As Long,n as Long
n=val(text1.text)
C=1
For i = 1 To n
C=C*i
Next i
Print C
End Sub
注意,如果n太大了,会溢出的哦。
private sub form1_click()
dim i as integer
dim temp as long
for i=1 to cint(text1.text)
temp=temp * i
next i
print temp;
end sub