Guest User

Untitled

a guest
Apr 27th, 2015
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. double f(double x)
  6. {
  7. return(0.25*(1 - 2 * pow(x, 3)));
  8. }
  9.  
  10. int main()
  11. {
  12. setlocale(LC_ALL, "Russian");
  13. double x = 0, x1 = 11, e;
  14. cout << "e: ";
  15. cin >> e;
  16. while (fabs(x1 - x) > e)
  17. {
  18. x = x1;
  19. x1 = f(x);
  20. }
  21. cout << x1 << endl;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment