Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
94611 张曦 斐波那契数列 C++ Accepted 1 MS 268 KB 428 2024-10-25 17:21:55

Tests(11/11):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int k; cin>>k; int a[k]; a[0]=1; a[1]=1; for(int i=2;i<=k;i++){ a[i]=a[i-1]+a[i-2]; } cout<<a[k]-a[k-2]; return 0; }