S=1!+3!+5!+7!+......+99!编程(两种方法)

来源:百度知道 编辑:UC知道 时间:2024/05/14 13:15:08
我要的是用高中数学的解法,只能使用IF ESLE DO LOOP UNTIL WHILE WEND等语句,不是电脑的编程,是数学题

s=0,a=1
for i from 1 to 99 step 2
for j from 1 to i step 2
a=a×j
end for
s=s+a
end for

s=0,a=1 ,j=1
while i<100 then
while j《=i then
a=a×j
j=j+2
end while
s=s+a
end while

s=0
t=1
For i from 1 to 99 step 2
For j from 1 to i
t=t*j
end For
s=s+t
end For
print s

s=0
t=1
i=1
while i<= 99
for j from 1 to i
t=t*i
end for
s=s+t
i=i+2
wend