HDU - 2018
思路
打表,找规律,
#include <bits/stdc++.h>
using namespace std;
const int N = 100;
int f[N] = {0,1,2,3},k = 3;
int main() {
int n;
while(cin >> n && n) {
if(n > k){
while(k <= n) {
k ++;
f[k] = f[k - 1] + f[k - 3];
}
}
cout << f[n] << endl;
}
return 0;
}