1312:【例3.4】昆虫繁殖
作者:互联网
1 #include<iostream> 2 #include<cstring> 3 using namespace std; 4 typedef long long ll; 5 const int N=55; 6 int main(){ 7 int x,y,z; 8 ll a[N],b[N]={0}; 9 cin>>x>>y>>z; 10 for(int i=1;i<=x;i++)a[i]=1; 11 for(int i=x+1;i<=z+1;i++){ 12 b[i]=y*a[i-x]; 13 a[i]=a[i-1]+b[i-2]; 14 } 15 cout<<a[z+1]; 16 return 0; 17 }
标签:include,1312,int,ll,long,3.4,繁殖,昆虫 来源: https://www.cnblogs.com/sxrekord/p/insect_reproduction.html