2. 编写求N!的函数过程fact(n%),调用fact(n%)函数在窗体单击事件中计算5!+8!-6!,并输出
Private Sub Command1_Click()
MsgBox fact(5) + fact(8) - fact(6)
End Sub
Function fact(n%) As Long
fact = 1
For i = 2 To n
fact = fact * i
Next
End Function
Private Sub Command1_Click()
MsgBox fact(5) + fact(8) - fact(6)
End Sub
Function fact(n%) As Long
fact = 1
For i = 2 To n
fact = fact * i
Next
End Function
多重随机标签