急急!!!!求助!!怎样用vb编写m!+(m+1)!+……+n!(m<n)

来源:百度知道 编辑:UC知道 时间:2024/05/22 00:58:10
不知道这个题咋做
我们还没学什么function,。。。你改的简单点吧。。还得赋值。。你貌似没有赋值

Private Function F(ByVal m As Integer, ByVal n As Integer) As Double
Dim i As Integer, j As Integer
Dim tmpA As Double, tmpB As Double
tmpB = 0
For i = m To n
tmpA = 1
For j = 1 To i
tmpA = tmpA * j
Next j
tmpB = tmpB + tmpA
Next i
F = tmpB
End Function

这个就是2个FOR ... NEXT嵌套啊!!!
如果你不喜欢NEXT后面的那个"i" "j" ,你把它去掉同样能运行!