4 条题解

  • -2
    @ 2026-6-3 20:27:26

    #include <bits/stdc++.h> using namespace std;

    int main() { int n; cin >> n; if (n == 1 || n == 2) { cout << 1 << endl; return 0; } int a = 1; int b = 1; int c;

    for (int i = 3; i <= n; i++) {
    	c = a + b;
    	a = b;
    	b = c;
    }
    cout << b << endl;
    return 0;
    

    }

    • @ 2026-6-3 20:32:06

      这题挺难的,我帮忙把代码输出来了,不会的可以复制过来。

信息

ID
30958
时间
1000ms
内存
256MiB
难度
2
标签
(无)
递交数
72
已通过
42
上传者