如何编这一题:计算S=1+ 1/2+1/4+1/7+1/11+1/16+1/22+1/29.,当第i项的值

问题描述:

如何编这一题:计算S=1+ 1/2+1/4+1/7+1/11+1/16+1/22+1/29.,当第i项的值

第一种方式:Private Sub Command1_Click()Dim a As IntegerDim i As IntegerDim S As Doublea = 1i = 1S = 0Do While (1 / a) > (1 / 10000)a = a + (i - 1)S = S + (1 / a)i = i + 1If i = 141 Then Print i; SLoo...