1! + 2! +... + 11! ,
#include
Void fac (int n);
{int I f;
For (I=1; i<=n; I++) f=f * I;
Returnf;//when debugging, set breakpoints
}
Voidmain ()
{int I add;
For (I=1; i<=11; I++)
The add=add + fac (I);//when debugging, set breakpoints
Printf (" 1! + 2! +... + 11! F=% \ n ", add);//when debugging, set breakpoints
}
CodePudding user response:
Is sent? Still?CodePudding user response:
In the two functions f, add no initialization, so you get the wrong numericalCodePudding user response:
Upstairs said to oh, his fac int f=1; His main int add=0; Initialization, or f, the add is a random numberCodePudding user response:
Send the wrong topic