VB上机题用多项式求出圆周率的近似值Private Sub Form_click()p1 = 1p2 = 1p3 = p1i = 1Do While p3 > 0.0000001 *p2 = (-1) * p2p3 = p2 / (i + 1) *p1 = p1 + p2 *i = i + 1LoopPrint p1 * 4End Sub打*号的又错,求改正!

问题描述:

VB上机题用多项式求出圆周率的近似值
Private Sub Form_click()
p1 = 1
p2 = 1
p3 = p1
i = 1
Do While p3 > 0.0000001 *
p2 = (-1) * p2
p3 = p2 / (i + 1) *
p1 = p1 + p2 *
i = i + 1
Loop
Print p1 * 4
End Sub
打*号的又错,求改正!