Advertisement
Qpel

funkcijos 1 užd rekursijav2

Mar 22nd, 2017
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. double rekursija(double x, int n){
  7.     if (n==256){
  8.         return pow(x,2) + n / pow(x,2);
  9.     }
  10.     else{
  11.         return pow(x,2) + n / rekursija(x, pow(n,2));
  12.     }
  13. }
  14. int main()
  15. {
  16.  
  17.     cout << rekursija(5, 2);
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement