牛牛学数列5
牛牛学数列5
https://ac.nowcoder.com/acm/problem/22160
#include <bits/stdc++.h> using namespace std; int main(void) { int n,s[500]; cin>>n; s[1]=1,s[2]=1; for(int i=3;i<=n;i++) s[i]=s[i-1]+s[i-2]; printf("%d\n",s[n]); }
牛牛学数列5
https://ac.nowcoder.com/acm/problem/22160
#include <bits/stdc++.h> using namespace std; int main(void) { int n,s[500]; cin>>n; s[1]=1,s[2]=1; for(int i=3;i<=n;i++) s[i]=s[i-1]+s[i-2]; printf("%d\n",s[n]); }
相关推荐