Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
102308 夏梓瑞 斐波那契数列(递归) C++ Runtime Error 38 MS 65800 KB 493 2024-12-21 14:52:46

Tests(0/15):


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()\fabs() #include<ctime> #include<cstdlib> using namespace std; int w(int n){ if(n==1) return 1; else if(n==0) return 0; else n-=1; return w(n-1)+w(n-2); } int main(){ int a; cin>>a; cout<<w(a); return 0; }


Run Info:

Runtime Error:Segmentation fault