int fibonacci(int positon){
if(position==1||position==2){
return 1;
}
return fibonacci(position-1)+fibonacci(position-2);
}
void test(){
int result=fibonacci(5);//查看斐波那契数列中第五个数的值
printf("%d\n",result);
}
int fibonacci(int positon){
if(position==1||position==2){
return 1;
}
return fibonacci(position-1)+fibonacci(position-2);
}
void test(){
int result=fibonacci(5);//查看斐波那契数列中第五个数的值
printf("%d\n",result);
}
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。