Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
134610 李亭绪 斐波那契数列 C++ Accepted 2 MS 272 KB 352 2025-10-29 19:12:21

Tests(11/11):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> using namespace std; int main(){ long long k,a=1,b=1,c,i=2; cin>>k; if(k<=2) { cout<<1; return 0; } while(i<k) { c=a+b; a=b; b=c; i++; } cout<<c; }