Advertisement
punidota

Untitled

Sep 19th, 2015
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include"math.h"
  4.  
  5. using namespace std;
  6. int main()
  7. {
  8.     #define pi 3,1415926
  9.     setlocale(LC_CTYPE, "Rus");
  10.     int n;
  11.     double x;
  12.     cout << "Введите x: ";
  13.     cin >> x;
  14.     cout << "Введите n: ";
  15.     cin >> n;
  16.     double fx = (pi / 2);
  17.     for (int i = 1; i <= n; i++)
  18.     {
  19.         fx += pow(-1, i + 1) / ((2 * i + 1) * pow(x, 2 * i + 1));
  20.     }
  21.     cout << "actgx = " << atan(fx) << endl;
  22.     system("pause");
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement