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()
- {
- int n, k;
- double x, s, d;
- s = 0;
- cin >> k >> x;
- d = ((-1) * x / 2);
- for (n = 1; n <= k; n++) {
- s += d / (7 * n);
- d *= ((-1) * x / 2);
- }
- cout << s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement