Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include "pch.h"
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. double eps,an;
  9. cout << "eps=";
  10. cin >> eps;
  11. int n = 1;
  12. an = (1.0 / pow(3, n))*(pow(cos(pow(3, n - 1)), 3));
  13. while ((1.0 / pow(3, n)) >= eps)
  14. {
  15. cout <<"a"<<n<<"="<< an<<endl;
  16. n++;
  17. an = (an*pow(cos(pow(3, n - 1)), 3)) / (3 * pow(cos(pow(3, n - 2)), 3));
  18. }
  19. cout << "________________________________________________________"<<endl;
  20. n = 1;
  21. while ((1.0 / pow(3, n)) >= eps)
  22. {
  23. an = (1.0 / pow(3, n))*(pow(cos(pow(3, n - 1)), 3));
  24. cout << an << endl;
  25. n++;
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement