标签:
# include <iostream> # include <cstdio> # include <cstring> # include <cmath> # include <string> # include <algorithm> # include <vector> using namespace std; int dp[1001]; int main() { int t; cin >> t; while(t--) { memset(dp, 0,sizeof(dp)); int n; cin >> n; dp[2] = 1; dp[3] = 2; for(int i = 4; i <= n; i++) { dp[i] = dp[i - 1] + dp[i - 2]; } cout << dp[n] << endl; } return 0; }
标签:
原文地址:http://www.cnblogs.com/lyf-acm/p/5457996.html