Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- double eps,an;
- cout << "eps=";
- cin >> eps;
- int n = 1;
- an = (1.0 / pow(3, n))*(pow(cos(pow(3, n - 1)), 3));
- while ((1.0 / pow(3, n)) >= eps)
- {
- cout <<"a"<<n<<"="<< an<<endl;
- n++;
- an = (an*pow(cos(pow(3, n - 1)), 3)) / (3 * pow(cos(pow(3, n - 2)), 3));
- }
- cout << "________________________________________________________"<<endl;
- n = 1;
- while ((1.0 / pow(3, n)) >= eps)
- {
- an = (1.0 / pow(3, n))*(pow(cos(pow(3, n - 1)), 3));
- cout << an << endl;
- n++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement