Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1.  
  2. #include "pch.h"
  3. #include <iostream>
  4. #include <iomanip>
  5. #include <math.h>
  6.  
  7. int main()
  8. {
  9. using namespace std;
  10. double a, b, h, x, y, s, p;
  11. int n, i;
  12. cout << "Vvedite a,b" << endl;
  13. cin >> a >> b;
  14. x = a;
  15. n = 150;
  16. h = (b - a) / 10;
  17. cout << setw(15) << "x" << setw(15) << "y" << setw(15) << "s" << endl;
  18. do
  19. {
  20. s = p = 0;
  21. for (i = 0; i <= n; i++)
  22. {
  23. p = ((pow(-1, i)) / (2 * i + 1))*pow(x, 2 * i + 1);
  24. s += p;
  25. }
  26.  
  27. y = atan(x);
  28. cout << setw(15) << x << setw(15) << y << setw(15) << s << endl;
  29. x += h;
  30. }
  31. while (x <= b );
  32. cout << endl;
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement