Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
102336 | 夏梓瑞 | 斐波那契数列(递归) | C++ | Accepted | 5 MS | 272 KB | 482 | 2024-12-21 15:00:26 |
#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()\fabs() #include<ctime> #include<cstdlib> using namespace std; int w(int n){ if(n==1) return 1; else if(n==0) return 0; else return w(n-1)+w(n-2); } int main(){ int a; cin>>a; cout<<w(a); return 0; }