Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- double e=1;
- int i=0 ;
- for(i=1;i<1000;++i){
- double a=1;
- int j=0;
- for(j=1;j<=i;++j){
- a=a*j;
- }
- a=1.0/a;
- e=e+a;
- }
- cout<<e<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment