Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
7784 | 黄言岐 | 斐波那契数列(递归) | C++ | Accepted | 2 MS | 268 KB | 393 | 2025-05-18 18:31:49 |
#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 a(int n){ if(n<2) return n; if(n>=2) return a(n-1)+a(n-2); } int main(){ int n; cin>>n; cout<<a(n)<<endl; return 0; }