vb编程计算s的值,其中s=1+1/2+1/3+...+1/n,n为正整数,当i项(即1/i<=0.01时结束

日期:2015-06-23 17:57:26 人气:1

vb编程计算s的值,其中s=1+1/2+1/3+...+1/n,n为正整数,当i项(即1/i<=0.01时结束

Private Sub Command1_Click()Dim i As IntegerDim s As DoubleDoi = i + 1s = s + 1 / iLoop Until 1 / i <= 0.01Print sEnd Sub
    A+
热门评论