vb 求一百项之和1+1/3+1/6+1/10+...+1/100
发布网友
发布时间:2024-08-22 09:25
我来回答
共3个回答
热心网友
时间:2024-09-01 13:16
private sub command1_click()
dim sum as single,tl as integer
dim i as integer,j as integer
for i=1 to 100
for j=1 to i
tl=tl+j
next j
sum=sum+1/tl
tl=0
next i
print sum
end sub
热心网友
时间:2024-09-01 13:17
原式=2/1*2+2/2*3+......+2/100*101
=2*(1/1*2+1/2*3+......+1/100*101)
=2*(1-1/2+1/2-1/3+......+1/100-1/101)
=2*(1-1/101)
=200/101
热心网友
时间:2024-09-01 13:12
=2/1*2+2/2*3+......+2/100*101
=2*(1/1*2+1/2*3+......+1/100*101)
=2*(1-1/2+1/2-1/3+......+1/100-1/101)
=2*(1-1/101)
=200/101