http://acm.hdu.edu.cn/showproblem.php?pid=2018
#include <bits/stdc++.h> using namespace std; const int maxn=1e5+10; int A(int x) { if(x<=4) return x; else return A(x-1)+A(x-3); } int main() { int n; while(~scanf("%d",&n)) { if(n==0) break; else printf("%d\n",A(n)); } return 0; }
原文:https://www.cnblogs.com/zlrrrr/p/9321163.html