Input x, calculation formula of the top 10 and above,
#include
#include
#include
Int main ()
{double x, I, sum, flag, a, b, j.
flag=1;
sum=0;
B=1;
Lf the scanf (" % ", & amp; X);
A=1/x;
for(i=1; i<=10; I++)
{a=a * x * x;
for(j=1; j<=2 * I - 1; J++)
B=b * j;
The sum +=flag * a/b;
Flag=- flag;
}
Printf (" % 3 "f, sum);
return 0;
} CodePudding user response:
B take too much, or every time before calculating the assignment 1 b, or the cycle change j CodePudding user response:
In the first layer circulation first sentence plus b=1; Or b will keep the previous value CodePudding user response: