Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main() {
- float sum = 0, e, next;
- next = -1 / 6;
- int i = 4;
- cin >> e;
- while (fabs(next) >= e) {
- sum += next;
- next *= -(i - 3) / i;
- ++i;
- }
- cout << "S = " << sum << "\n";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement