提交时间:2023-08-10 12:58:14
运行 ID: 24295
#include <iostream> using namespace std; int main() { int sum, n1, n2, k; n1=1; n2=1; cin >> k; for (int i = 3; i <= k; i++) { sum = n1 + n2; n2 = n1; n1 = sum; } cout << sum; return 0; }