利用格里高利公式 求π,直到最后一项的值小于0.0001为止,输出π的值。 Private Sub Command1_Click()
Dim Pi As Single, t As Single
Dim n As Integer, s As Integer
Pi = 0
t = 1: n = 1: s =1
Do While Abs(t) >= 0.0001
Pi = Pi + t
n ={#blank#}1{#/blank#}
s= {#blank#}2{#/blank#}
t = s / n
Loop
Text2.Text ={#blank#}3{#/blank#}
End Sub