数列 1,1,2,3,5,8,13,……,前两项之后构成后一项
#include<bits/stdc++.h>
using namespace std;
int Fbi(int i){
if(i<2)
return i==0?0:1;
return Fbi(i-1)+Fbi(i-2);
}
int main(){
int i;
for(int i=1;i<40;i++)
printf("%d ",Fbi(i));
return 0;
}
数列 1,1,2,3,5,8,13,……,前两项之后构成后一项
#include<bits/stdc++.h>
using namespace std;
int Fbi(int i){
if(i<2)
return i==0?0:1;
return Fbi(i-1)+Fbi(i-2);
}
int main(){
int i;
for(int i=1;i<40;i++)
printf("%d ",Fbi(i));
return 0;
}