FelhageDike1

Untitled

Dec 8th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. int n2, x;
  8. double s2 = 0;
  9. cin >> n2 >> x;;
  10. for (int i = 1; i <= n2; ++i) {
  11. s2 += 1 + (pow(-1, (i + 1)) * pow(x, (i * 2) + 1) / pow(i, 3) + pow(i, 2));
  12. }
  13. cout << s2;
  14. return 0;
  15.  
  16. }
Add Comment
Please, Sign In to add comment