标签:
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; int main() { long long dp[50]; int n; while(~scanf("%d",&n)){ dp[1] = 2; dp[2] = 2; for(int i = 3; i <= n; i++) dp[i] = dp[i-1] + dp[i-2]; printf("%lld\n",dp[n]); } return 0; }
标签:
原文地址:http://www.cnblogs.com/zero-begin/p/4482909.html