Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cmath>
- #include "pch.h"
- //using namespace System;
- //using namespace System::Windows::Forms;
- using namespace std;
- double Count(double x, double e, int Nmax, System::Windows::Forms::ListBox^ LB)
- {
- double y0, y;
- y = 1;
- int i = 0;
- do
- {
- y0 = y;
- y = 1.5 * y0 - 0.5 * x * y0 * y0 * y0;
- i++;
- System::String^ fs = System::String::Format("{0,2:D2}{1,15:F9}", i, y);
- LB->Items->Add(fs);
- //cout << "Итерация " << i << ": Значение уравнения " << y << endl;
- } while (abs(y - y0) >= e && i < Nmax);
- return y;
- }
Add Comment
Please, Sign In to add comment