Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- double Rec (int n)
- {
- if(n==1) return(1);
- return(sqrt(sqrt(n)+Rec(n-1)));
- }
- int main()
- {
- int n;
- cout << "Vvedite kolvo elementov:" << endl;
- cin>> n;
- double k=0;
- //------------------------------------------
- for (int i=1;i<=n;i++)
- {
- k=sqrt(sqrt(i)+k);
- }
- //------------------------------------------
- cout<<k<<endl;
- cout<< Rec(n);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement