Advertisement
swojcik

Untitled

Apr 11th, 2016
67
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.  
  3. using namespace std;
  4.  
  5. int ciag(int n)
  6. {
  7.     if(n == 0)
  8.     {
  9.         return 2;
  10.     }
  11.     else if( n == 1)
  12.     {
  13.         return 1;
  14.     }
  15.     else
  16.     {
  17.         return 2/(2+ (ciag(n-1)*ciag(n-2)) );
  18.     }
  19. }
  20. int main()
  21. {
  22.     int x = ciag(1);
  23.     cout<<x;
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement