#include <stdio.h>
int cows(int n)//求母牛的递归函数
{
int i,count = 0;
if (n < 4)
return 1;
else
for (i = 1; i <= n - 3; i++) // 把新出生的小母牛代到递归函数里进行运算
count += cows (i);
return count + 1;
}
void main()
{
printf("please iput the years: \n");
int m;
scanf("%d",&m);
printf("in the %d year,there will be the %d cows.\n",m,cows(m));
getchar();
}