Advertisement
AndreyKlipikov

[Olegu] Prog. Lab5. N26

Dec 25th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <math.h>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.     double x = 0.1, h = 0.05;
  9.     int n = 20;
  10.  
  11.     while (x < 0.8 + h)
  12.     {
  13.         double y = log(1 - x * x), s = 0;
  14.  
  15.         for (int i = 1; i <= n; i++)
  16.             s -= pow(x, i * 2) / i;
  17.  
  18.         cout.precision(4);
  19.         cout << "| " << x << "\t| " << y << "\t| " << s << "\t|" << endl;
  20.         x += h;
  21.     }
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement