c++, 计算正弦的近似值。sin(x)=x-x^3/3!+x^5/5!-x^7/7!+…… 要求用while、do-while和for循环语句
c++, 计算正弦的近似值。sin(x)=x-x^3/3!+x^5/5!-x^7/7!+…… 要求用while、do-while和for循环语句
日期:2018-05-06 23:08:27 人气:2
Private Sub Command2_Click()
Dim x, an, sinx, n
x = Val(InputBox("x="))
an = x
n = 1
jc = 1
sinx = 0
Do Until Abs(an) < 10 ^ -6
sinx = sinx + an
n = n + 1
jc = jc * (2 * n - 2) * (2 * n - 1)
an = (-1) ^ (n - 1) * x ^ (2 * n - 1) &