斐波那契数列 猴子吃桃,兔子繁殖
斐波那契数列 猴子吃桃,兔子繁殖问题#include<studio.h>int Tao(int day,int tao){if(day1)return tao;elsereturn Tao(day-1,(tao+1)*2);}int Rabbit(int rb){if(rb1||rb==2)return rb;elsereturn Rabbit(rb-1)+Rabbit(rb-2);}int main(){printf(“%d\n”,Tao(10,1));/
原创
2020-11-22 16:38:13 ·
219 阅读 ·
0 评论