Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. int main() {
  5. float sum = 0, e, next;
  6. next = -1 / 6;
  7. int i = 4;
  8. cin >> e;
  9. while (fabs(next) >= e) {
  10. sum += next;
  11. next *= -(i - 3) / i;
  12. ++i;
  13. }
  14. cout << "S = " << sum << "\n";
  15. system("pause");
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement