Advertisement
Andrey_99_cska

5.III.4

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