Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <algorithm>
- using namespace std;
- int main() {
- setlocale(LC_ALL, "rus");
- int k;
- double res = 1;
- double x;
- cin >> x >> k;
- double elem = x;
- for (int n = 2; n <= k; ++n) {
- res *= (1 + elem);
- elem *= x / n;
- }
- cout << res * elem << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement