发布网友 发布时间:2024-10-21 17:45
共1个回答
热心网友 时间:2分钟前
Private Sub Command1_Click()
Dim sign As Integer, a As Long, pi As Double
Dim i As Integer
sign = -1
i = 1
Do
a = 2 * i - 1
sign = -1 * sign
pi = pi + (1 / a) * sign
i = i + 1
Loop While Abs((1 / a) * sign) > 0.0001
pi = pi * 4
Print pi
End Sub