Private Sub Command1_Click()
k = 1
Do While 1 / (2 * k - 1) >= 10 ^ (-4)
s = s + (-1) ^ (k - 1) / (2 * k - 1)
k = k + 1
Loop
Print "π≈"; 4 * s
End Sub
Private Sub Command1_Click()
p = 0
i = 1
t = 1
While i < 1000000
p = p + t / i
i = i + 2
t = -t
Wend
Text1.Text = "圆周率的值近似为:" & 4 * p
End Sub
请先把刚才回答的那个采纳了吧。