VF循环结构,如何做1-1/2+1/3-1/4+...-1/100
问题描述:
VF循环结构,如何做1-1/2+1/3-1/4+...-1/100
答
clear set talk off s=0 for i=1 to 100 s=s+(-1)^(i+1)*(1/i) endfor "1-1/2+1/3-1/4+...+1/100=",s set talk on