急!告诉用VB循环语句求1!+(1!+2!)+…(1!+2!+…+10!).
来源:百度知道 编辑:UC知道 时间:2024/05/31 06:18:01
Sub factsum2()
Dim i As Integer
Dim sum, st, sr As Double
sum = 0
sr = 0
st = 1
For i = 1 To 10
st = st * i
sr = sr + st
sum = sum + sr
Next i
MsgBox sum
End Sub
这个 可以先化简一下嚒
10*1!+9*2!……+ 1*10!
sub a ()
dim JC
JC=1
for i=1 to 10
for j= 1 to i
JC = JC *i
next j
sum=(11 -i)*JC+ sum
next i