Guest User

Untitled

a guest
Apr 27th, 2015
317
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.11, x1, e;
  14. cout << "e: ";
  15. cin >> e;
  16. x1 = f(x);
  17. while (fabs(x1 - x) > e)
  18. {
  19. x = x1;
  20. x1 = f(x);
  21. }
  22. cout << ;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment