Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main(void) {
- double S = 1, elem = 1, eps;
- cin >> eps;
- for (int i = 0; fabs(elem) > eps; ++ i) {
- elem *= -1 / ((2.0 * i + 2) * (2.0 * i + 3));
- S += elem;
- }
- cout << S << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment