VB求圆周率∏的近似值.公式为 = 1- + - …+(-1)(n+1)× ,直到最后一项的绝对值小

问题描述:

VB求圆周率∏的近似值.公式为 = 1- + - …+(-1)(n+1)× ,直到最后一项的绝对值小

应该是 Pi/4=1-1/3+1/5-1/7+…+(-1)^(n-1)/(2*n-1)吧,Private Sub Form_Load()Dim Pi As Single,i As LongForm1.AutoRedraw = Truei = 1DoPi = Pi + (-1) ^ (i - 1) / (2 * i - 1)i = i + 1Loop Until 1 / (i * 2 ...