Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "rus");
- float a, b, e,x,y,xp,yp;
- cout << "a=";
- cin >> a;
- cout << "b=";
- cin >> b;
- cout << "e=";
- cin >> e;
- xp = a; x = xp;
- yp = b; y = yp;
- while (fabs(x - y) < e)
- {
- cout <<"x="<< x<<endl;
- x = xp + yp;
- //cout << "xnew= " << x;
- y = sqrt(x*yp);
- //cout << " y=" << y<<endl;
- xp = x;
- yp = y;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement