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