分类：电脑/网络-软件
问题：VB高手帮我检查一下题目是：计算S=1+1/2+1/4+1/7+ 
题目是：计算 S=1+1/2+1/4+1/7+1/11+1/16+……当第i项的值<10^-4是结束。

我运行时 总是输出为0.
帮忙检查一下！

Dim i, s, a, b As Single
s = 0
a = 1
b = 0
i = 1 / a
Do While i < 10 ^ (-4)
    a = a + b
    b = b + 1
    s = s + i
Loop

Print s
回答：Sub 按钮1_单击()
Dim i, s, a, b As Single
s = 0
a = 1
b = 0
i = 1 / a
Do While i >= 0.0001
a = a + b
b = b + 1
s = s + i
i = 1 / a
Loop
MsgBox s
End Sub