Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #include <iomanip>
- #include <math.h>
- int main()
- {
- using namespace std;
- double a, b, h, x, y, s, p;
- int n, i;
- cout << "Vvedite a,b" << endl;
- cin >> a >> b;
- x = a;
- n = 150;
- h = (b - a) / 10;
- cout << setw(15) << "x" << setw(15) << "y" << setw(15) << "s" << endl;
- do
- {
- s = p = 0;
- for (i = 0; i <= n; i++)
- {
- p = ((pow(-1, i)) / (2 * i + 1))*pow(x, 2 * i + 1);
- s += p;
- }
- y = atan(x);
- cout << setw(15) << x << setw(15) << y << setw(15) << s << endl;
- x += h;
- }
- while (x <= b );
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement