大神们能不能看看我这个为啥不对,谢谢
#include <stdio.h>
#include<math.h>
int main()
{
int i,j;//循环变量
int flag=1; //符号位
double term; //分数
long n=1,counter=0; // n为 次数 ,counter为次数
double sin=0; //有符号的分数
double x; //x为输入量
double s=1,f;//s为分数的分子,f为分母
f=1;
printf("Input x:\n");
scanf("%lf",&x);
do
{
for(j = 1;j <= n;j++)
s*= x;
for(i=1;i<n;i++)
f=f*(f+1);
term=s/f;
sin+=flag*term;
n+=2;
flag=-flag;
counter++;
}while(term<1e-5);
printf("sin(x)=%.3f,count=%d\n",sin,counter);
return 0;
}