// 递推
// 数列 0 1 1 2 3 5 8 13 21 ... 被称为斐波纳契数列
#include<iostream>
#include<cstring>
using namespace std;
const int N=50;
int n;
int f[N];
int main(){
cin>>n;
f[0]=0;
f[1]=1;
f[2]=1;
for(int i=3;i<n;i++){
f[i]=f[i-1]+f[i-2];
}
for(int i=0;i<n;i++){
cout<<f[i]<<" ";
}
cout<<endl;
return 0;
}
标签:数列,717,斐波,int,那契,include
From: https://www.cnblogs.com/mengfengguang/p/16846564.html