Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment