#include <stdio.h>
int fibonacci(int n);
int main(int argc, char const *argv[])
{
/* code */
printf("input your month:");
int month =0;
scanf("%d",&month);
int number = fibonacci(month);
printf("rabbit number = %d\n",number );
return 0;
}
int fibonacci(int n){
if(n == 0 || n == 1){
return 1;
}else{
return fibonacci(n-1)+fibonacci(n-2);
}
}
转载于:https://blog.51cto.com/konger/1341979