Quipex icon

Laba_3.6_XIII

Quipex | PRO | 10/11/15 08:17:53 PM UTC | 0 ⭐ | 266 👁️ | Never ⏰ | []
C++ |

500 B

|

None

|

0 👍

/

0 👎

// laba_3.6_XIII.cpp : Defines the entry point for the console application.
//
 
#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <clocale>
using namespace std;
 
 
int main()
{
    setlocale(LC_CTYPE, "rus");
    double s,y,p,a=-2,b=-0.1,h,x=0;
    h=(b-a)/10;
    int i,n=160;
    x=a;
    do
    {
        s=0;
        for(i=1;i<=n;i++)
        {
            p=powf(-1,i)*powf(1+x,2*i)/i;
            s+=p;
        }
        y=log(1/(2+2*x+x*x));
        cout<<setw(15)<<s<<setw(15)<<y<<endl;
        x+=h;
    }
    while(x<-0.1);
    return 0;
}

Comments