Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include <bits/stdc++.h>
- using namespace std;
- int32_t main()
- {
- int n, x;
- cin >> n >> x;
- double ans = 0;
- double p = 1;
- double f = 1;
- for (int i = 1; i < n + 2; ++i)
- {
- ans += p / f;
- p *= x;
- f *= i;
- }
- cout << fixed << setprecision(6) << ans;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment