题解 | #牛牛学数列7#
牛牛学数列7
https://ac.nowcoder.com/acm/problem/22211
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
long long f[51]={0,0,1,1,2,3,5,8};
cin>>n;
for(int i=7;i<=n;i++) f[i]=f[i-1]+f[i-2];
cout<<f[n];
return 0;
}