Private Sub Command1_Click()
Dim a As Integer, b As Integer, c As Integer
Dim p As Long
a = Val(InputBox("A="))
b = Val(InputBox("B="))
c = Val(InputBox("C="))
p = jc(a) + jc(b) + jc(c)
Print a & "!+" & b & "!+" & c & "!=" & p
End Sub
Function jc(n As Integer)
If n > 1 Then
jc = n * jc(n - 1)
Else
jc = 1
End If
End Function