Advertisement
awsmpshk

Untitled

Jan 16th, 2020
127
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. setlocale(LC_ALL, "rus");
  9. int k;
  10. double res = 1;
  11. double x;
  12. cin >> x >> k;
  13. double elem = x;
  14. for (int n = 2; n <= k; ++n) {
  15. res *= (1 + elem);
  16. elem *= x / n;
  17. }
  18. cout << res * elem << endl;
  19. return 0;
  20. }
Advertisement
RAW Paste Data Copied
Advertisement