通过代码:
#include <bits/stdc++.h> #define LL long long using namespace std; int x, y, z; LL Old[101], New[101]; int main(){ scanf("%d%d%d", &x, &y, &z); for(int i = 1; i <= x; i ++) Old[i] = 1, New[i] = 0; for(int i = x + 1; i <= z + 1; i ++) { New[i] = y * Old[i - x]; Old[i] = Old[i - 1] + New[i - 2]; } printf("%lld", Old[z + 1]); return 0; }
1312:【例3.4】昆虫繁殖
最新推荐文章于 2024-08-28 10:40:00 发布