标签:
http://acm.hdu.edu.cn/showproblem.php?pid=2018
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 50087 Accepted Submission(s): 25017
#include <iostream> using namespace std; int f(int a) { if(a<5) return a; else return f(a-1)+f(a-3); } int main() { int n; while(cin>>n) { if(n==0) break; cout<<f(n)<<endl; } return 0; }
标签:
原文地址:http://www.cnblogs.com/cancangood/p/4392847.html