提交时间:2026-07-18 18:10:23

运行 ID: 92684

#include <bits/stdc++.h> using namespace std; int main() { int x,y,z; int f[100]={0}; cin>>x>>y>>z; for(int i = 1; i <= x; i ++) { f[i] = 1; } for(int i = x + 1; i <= z + 1; i ++) { f[i] = f[i - 1] + (i - x - 2 > 0 ? f[i - x - 2] * y : 0); } cout<<f[z+1]; return 0; }