Guest User

Untitled

a guest
Feb 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int n,i,c;
  6.     float p;
  7.     scanf("%d",&n);
  8.     p=2;c=1;
  9.     for (i=1;i<n;i++)
  10.     {
  11.         c*=(i+1);
  12.         p*=(1+ 1.0/c);
  13.     }
  14.     printf("%f\n",p);
  15.     return 0;
  16. }
Add Comment
Please, Sign In to add comment