Run ID:103746

提交时间:2024-12-29 15:06:15

#include <bits/stdc++.h> using namespace std; int main() { int k, n2 = 1, n1 = 1, t; cin >> k; if (k <= 2) { cout << 1; } else { for (int i = 3; i <= k; ++i) { t = n1 + n2; n2 = n1; n1 = t; } cout << n1; } return 0; }