Public Sub nJC(nSJ%) As Double Dim i% nJC = 1 If nSJ >= 2 Then For i = 2 To nSJ nJC = nJC * i Next i End If End Sub Private Sub 计算_Click() Dim m%, n%, s#, cTS$ m = Val(InputBox("请输入 m(m >= 1)")) n = Val(InputBox("请输入 n(n >= 1)")) s = nJC(n) * nJC((m - n)) If Abs(s) < 1e-10 Then cTS = "输入数据有错!" Else s = nJC(m) / s cTS = "所求 s =" & Str(s) End If MsgBox cTS, 0 + 64, "计算结果" End Sub