Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- int main()
- {
- int n;
- float x, s = 0, b = 1;
- cin >> x;
- cin >> n;
- for (int i = 1; i <= n; i++)
- {
- b += x; s += ((pow((-1), i)*b) / (pow(2, i) * 7 * i));
- }
- cout << s<<endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement