SHARE
TWEET

Untitled

a guest Feb 27th, 2020 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. double Rec (int n)
  8. {
  9.     if(n==1) return(1);
  10.     return(sqrt(sqrt(n)+Rec(n-1)));
  11. }
  12.  
  13. int main()
  14. {
  15.     int n;
  16.  
  17.     cout << "Vvedite kolvo elementov:" << endl;
  18.     cin>> n;
  19.     double k=0;
  20.     //------------------------------------------
  21.     for (int i=1;i<=n;i++)
  22.     {
  23.         k=sqrt(sqrt(i)+k);
  24.     }
  25.     //------------------------------------------
  26.     cout<<k<<endl;
  27.    cout<< Rec(n);
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top