powerunlimited

Untitled

Oct 25th, 2012
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int main(){
  5.     double e=1;
  6.     int i=0 ;
  7.     for(i=1;i<1000;++i){
  8.         double a=1;
  9.         int j=0;
  10.         for(j=1;j<=i;++j){
  11.             a=a*j;
  12.         }
  13.         a=1.0/a;
  14.         e=e+a;
  15.     }
  16.     cout<<e<<endl;
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment