995
  • 板块P1255 数楼梯
  • 楼主lizishi
  • 当前回复1
  • 已保存回复1
  • 发布时间2025/1/19 20:18
  • 上次更新2025/1/20 08:15:51
查看原帖
995
1165586
lizishi楼主2025/1/19 20:18
#include <iostream>

#define please return -995+

using namespace std;

int main() {
    int n;
    cin >> n;
    int a[n + 10] = {0};
    a[0] = a[1] = 1;
    for (int i = 2; i <= n; i++) {
        a[i] = a[i - 1] + a[i - 2];
    }
    cout << a[n];
    please 995;
}
2025/1/19 20:18
加载中...