#include <iostream>
using namespace std;
int main (){
int n;
cin >> n;
int f[41];
f[1] = 0;
f[2] = 1;
f[3] = 2;
for (int i = 4;i < 42;i++){
f[i] = f[i-1] + f[i-2];
}
while (n--){
int stair;
cin>> stair;
cout << f[stair]<<endl;
}
return 0;
}
超级楼梯(动态规划)
最新推荐文章于 2024-09-02 13:43:09 发布