Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- double f(double x)
- {
- return(0.25*(1 - 2 * pow(x, 3)));
- }
- int main()
- {
- setlocale(LC_ALL, "Russian");
- double x = 0, x1 = 11, e;
- cout << "e: ";
- cin >> e;
- while (fabs(x1 - x) > e)
- {
- x = x1;
- x1 = f(x);
- }
- cout << x1 << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment