vb计算1!+3!+*****+(2n+1)!的代码Private Sub Command1_Click()Dim n As Integer, i As Integer, j As Integern = Val(InputBox("请输入N值"))m = 1: Sum = 0For i = 1 To 2 * n + 1 Step (2)For j = 1 To im = m * jNext jSum = Sum + mNext iPrint SumEn
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/28 01:46:08
vb计算1!+3!+*****+(2n+1)!的代码Private Sub Command1_Click()Dim n As Integer, i As Integer, j As Integern = Val(InputBox("请输入N值"))m = 1: Sum = 0For i = 1 To 2 * n + 1 Step (2)For j = 1 To im = m * jNext jSum = Sum + mNext iPrint SumEn
vb计算1!+3!+*****+(2n+1)!的代码
Private Sub Command1_Click()
Dim n As Integer, i As Integer, j As Integer
n = Val(InputBox("请输入N值"))
m = 1: Sum = 0
For i = 1 To 2 * n + 1 Step (2)
For j = 1 To i
m = m * j
Next j
Sum = Sum + m
Next i
Print Sum
End Sub
这是我编的,但算出来不对,求高手帮忙指错
vb计算1!+3!+*****+(2n+1)!的代码Private Sub Command1_Click()Dim n As Integer, i As Integer, j As Integern = Val(InputBox("请输入N值"))m = 1: Sum = 0For i = 1 To 2 * n + 1 Step (2)For j = 1 To im = m * jNext jSum = Sum + mNext iPrint SumEn
Private Sub Command1_Click()
Dim n As Integer,i As Integer,j As Integer,Sum&,m&
n = Val(InputBox("请输入N值"))
Sum = 0
For i = 1 To 2 * n + 1 Step 2
m = 1 '这儿要加上此句
For j = 1 To i
m = m * j
Next j
Sum = Sum + m
Next i
Print Sum
End Sub