Rabbit recursion item value of the n number of columns

. 1 #include <the iostream>
 2  the using  namespace STD;
 . 3  int f ( int n) // n-th column item recursive f 
. 4  {
 . 5      int X = 0 , Y = . 1 , Z;
 . 6      IF (n == . 1 || == n- 2 )
 . 7      {
 . 8          return N- . 1 ;
 . 9      }
 10      the else 
. 11      {
 12 is          return F (N- . 1 ) + F (N- 2 );
 13 is      }
14 }
15 main()
16 {
17     int a;
18     cin>>a;
19     cout<<f(a);
20 }

 

Guess you like

Origin www.cnblogs.com/wanjinliu/p/11391555.html