Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement