母牛的故事
#include<stdio.h>
int fun(int x)
{
if(x==1)
return 1;
else if(x==2)
return 2;
else if(x==3)
return 3;
else return fun(x-1)+fun(x-3);
}
int main( )
{
int N;
while(scanf("%d",&N)!=EOF,N)
printf("%d\n",fun(N));
return 0;
}
posted on 2011-04-28 16:17 more think, more gains 阅读(158) 评论(0) 收藏 举报
浙公网安备 33010602011771号