Advertisement
SergeyPGUTI

6.2.4

Nov 20th, 2015
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int phi(int n)
  7. {
  8.     if (n<2) return 1;
  9.     else return phi(n-1)+phi(n-2);
  10. }
  11.  
  12. int main()
  13. {
  14.     int n;
  15.     cin>>n;
  16.     cout<<phi(n);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement