标签:递推
#include<stdio.h> int main() { int f[31]; int i,L; int n; f[0]=1; for(i=1;i<=30;i+=2) f[i]=0; for(i=2;i<=30;i+=2) { f[i]=0; for(L=2;L<=i;L+=2) { if(L==2) f[i]+=3*f[i-L]; else f[i]+=2*f[i-L]; } } while(scanf("%d",&n),n!=-1) printf("%d\n",f[n]); return 0; }
标签:递推
原文地址:http://blog.csdn.net/u014705854/article/details/41087799