标签:
2 4 5 0
2 4 6
#include <iostream> #include <cstdio> #include <cstring> using namespace std; int main(){ int a[56]; a[1]=1;a[2]=2;a[3]=3,a[4]=4; int n,i; for(i=5;i<56;++i){ a[i]=a[i-1]+a[i-3]; } while(cin>>n&&n){ cout<<a[n]<<'\12'; } return 0; }
标签:
原文地址:http://blog.csdn.net/zp___waj/article/details/46381705