VB表达式:计算S=1+1/2+1/4+1/7+1/11+1/16+1/22+1/29+···当第i项的值
人气:251 ℃ 时间:2020-03-20 01:56:44
解答
Private Sub Command1_Click()
Dim i As Long
Dim a As Double
Dim s As Double
Dim stp As Integer
stp = 1
i = 1
Do While True
If 1 / i < 10 ^ -4 Then Exit Do
a = 1 / i
s = s + a
i = i + stp
stp = stp + 1
Loop
Print s
End Sub
推荐
猜你喜欢
- 有一块长方形石块,长是48cm,宽是30cm,高是10cm,加工时把长、宽、高各凿去5cm,体积减少多少?
- 为什么月亮出来星星就少了
- 如图 已知四边形ABCD中,AB⊥BC,AB=4cm,BC=3cm,CD=12cm,AD=13cm,则四边形ABCD的面积是多少
- (2011•凉山州)已知y=2x−5+5−2x−3,则2xy的值为( ) A.-15 B.15 C.−152 D.152
- 根号49的平方根为什么是正负根号7?根号49的平方.的平方根.为什么又是正负7?怎么回事.说具体点.
- 比大小:9分之5()8分之3 3分之1()4分之1
- Hardly had I entered the room when the telephone rang的翻译
- Sometimes people say, “It’s not broken, why are you trying to fix it? Why are you breaking it?”