65,187
社区成员




#include"iostream"
using namespace std;
int main()
{
long n,i,a=1,b=0,c=0,d=0,sum=0;
while(true)
{
cout<<"Enter the year:";
cin>>n;
if(n<=0)
{
cout<<"you are willing to quit."<<endl;
break;
}
for(i=1;i<=n;i++)
{
d=c+d;
c=b;
b=a;
a=d;
sum=a+b+c+d;
}
cout<<"the number of cow is "<<sum<<endl;
}
return 0;
}