八字换大运移花接木:VF6.0问题

来源:百度文库 编辑:查人人中国名人网 时间:2024/07/05 16:25:57
编程计算s=1!+2!+3!+4!+5!的值
用VF遍,我写了但是不对啊,我写的是
set talk off
clear
s=0
for i=1 to 5
for j=1 to i
p=i*j
s=s+p
?s
endfor
endfor

?s
_________________________
得数是140,实际应该是153啊请问错哪了怎么改

改一下试试
set talk off
clear
s=0
for i=1 to 5
p=1
for j=1 to i
p=p*j
endfor
s=s+p
endfor

?s