int main()
{
double x,sinx=0.0,jbf,j=1.0;
cin>>x;
jbf=x;
int k=1,l=1;
double n=1;
while(j>=1e-6)
{
j=jbf/n;
sinx=sinx+k*j;
jbf=jbf*x*x;
k=-k;
n=n*(l+1)*(l+2);
l+=2;
}
15.求函数:sin(x)=x/1! - x3/3! + x5/5! -x7/7! +…,最后一项精度不低于0.000001,布布扣,bubuko.com
15.求函数:sin(x)=x/1! - x3/3! + x5/5! -x7/7! +…,最后一项精度不低于0.000001
原文:http://www.cnblogs.com/jixiaowu/p/3893224.html