Добавил:
masterdos
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:
#include <iostream.h>
#include <iomanip.h>
#include <conio.h>
#include <stdio.h>
#include <math.h>
int main()
{
double a,b,h,x,y,s,p;
int n,i;
cout << "Vvedite a,b,n" << endl;
cin >> a >> b >> n;
h=(b-a)/10;
x=a;
do
{
p=s=1;
for (i=0; i<=n; i++)
{
s += pow((-1),i)*pow(1+x,(2*n))/(n);
}
y=log(1/(2+2*x+x*x));
cout << setw(15) << x << setw(15) << y << setw(15) << s << endl;
x += h;}
while (x <= b+h/2);
cout << endl;
return 0;
}