#include
Int main ()
{
Double eps, sum, S;
The scanf (" % f ", & amp; Eps);
For (S - 1; Fabs (1/S) & gt; Eps; S +=3)
{
If (S % 2==0) {
S=(1) * S +=3; }
Sum=S + 1/S;
}
return 0;
}
(the great god, please take a ha I this where there is a problem) thank you
CodePudding user response:
S not initialized, in addition, S also should not be type double, S % 2 more than take action against have so of floating point calculation? I have heard of integer have take operationCodePudding user response:
#include#include
Int main ()
{
Double eps, S=0;
Int a=1, j;
Lf the scanf (" % ", & amp; Eps);
For (j=1; J +=3)
{
S +=a * 1.0/j;
A=(1) * a;
If (1/j<=(eps) break;
}
Printf (" sum=%. 6 f ", S);
return 0;
}
(the eldest brother behind me into this, shown on the pta still has a lot of mistakes, can you help me to find it, I was looking for a long time) thank you again for the answer eldest brother
CodePudding user response:
Ok the eldest brother, I know where is the problem of theThank you for your help me to find out the so big mistake!!!!!! Thank you very much!!!!!!