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);

}

相关文章:

  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-23
  • 2022-12-23
  • 2021-06-04
  • 2021-10-16
  • 2022-12-23
相关资源
相似解决方案