VB计算1!+2!+3!+…+n!的和
问题描述:
VB计算1!+2!+3!+…+n!的和
答
Private Sub Command1_Click() Dim S As Double, jc As Double, N As Integer jc = 1 N = Val(InputBox("请输入N")) For i = 1 To N jc = jc * i S = S + jc Next Print "S="; S End Sub