Private Function jc(ByVal n As Long) As Long'阶乘
If n = 1 Then
jc = 1
Else
jc = n * jc(n - 1)
End If
End Function
Private Sub Command1_Click()
Dim n As Integer, Sum As Long
n = 1
Do While n <= 10
Sum = Sum + jc(n) * (-1) ^ (n - 1)
n = n + 1
Loop
Print Sum
End Sub