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