![]() |
Главная Случайная страница Контакты | Мы поможем в написании вашей работы! | |
|
#include <iostream.h>
#include <stdio.h>
#include <math.h>
float a, b, EPS=10E-7;
float x1, DELTA, x2;
int n=0;
int main() {
cout<< "\n\n*********************************************************************\n\n";
cout<< " Metod dotuchnuh (2.1.8) ";
cout<< "\n\n*********************************************************************\n\n";
cout<< " Vvedit megi a: "; cin>>a;
cout<< " b: "; cin>>b;
x1=(a+b)/2;
do { n=n+1;
x2=x1-(log(x1)*log(x1)-log(x1)-2)/(2*log(x1)/x1-1/x1);
DELTA=fabs(x2-x1);
if (DELTA>EPS)
x1=x2; }
while(DELTA>EPS);
printf (" Korin'=%40.37f\n",x2);
printf (" Chuslo iteratsiu=%i",n);
cout<< "\n\n*********************************************************************\n\n";
printf (" Tochnist E = %40.37f\n",EPS);
getchar();
return 0;
Дата публикования: 2015-10-09; Прочитано: 266 | Нарушение авторского права страницы | Мы поможем в написании вашей работы!