Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main() {
- int n2, x;
- double s2 = 0;
- cin >> n2 >> x;;
- for (int i = 1; i <= n2; ++i) {
- s2 += 1 + (pow(-1, (i + 1)) * pow(x, (i * 2) + 1) / pow(i, 3) + pow(i, 2));
- }
- cout << s2;
- return 0;
- }
Add Comment
Please, Sign In to add comment