vb 求π近似值
用公式:π=2*(2^2/1*3)*(4^2/3*5).(2n)^2/[(2n-1)*(2n+1)]
用for 和 while 分别写一下,
人气:345 ℃ 时间:2020-02-02 09:54:03
解答
Private Sub Command1_Click()Dim N As Double, Pi As DoublePi = 2For N = 1 To 1000Pi = Pi * (2 * N) ^ 2 / ((2 * N - 1) * (2 * N + 1))If N = 10 Then Print PiIf N = 100 Then Print PiIf N =...
推荐
猜你喜欢