Home > Back-end >  Input is an integer n, calculate s=1/1! 1/2! A third! . 1/n! The value of the.
Input is an integer n, calculate s=1/1! 1/2! A third! . 1/n! The value of the.

Time:05-18

CodePudding user response:

Reference:
 # include 

Int main ()
{
Int j, k, n.
Double f, s;

The scanf (" % d ", & amp; N);
S=0.0;//2
for(k=1; K<=n; K++) {
F=1.0;//2
For (j=1; J<=k; J++)//3 points
F *=j;//3 points
S=s + 1.0/f;
}
Printf (" sum=% f \ n ", s);

return 0;
}

CodePudding user response:

The building Lord what problem? Header file write function, not seen such a writing yet,
  • Related