Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
236 | Benson | 斐波那契数列(递归) | C++ | Accepted | 3 MS | 256 KB | 334 | 2022-07-22 10:38:17 |
#include<iostream> #include<cstring> #include<cmath> using namespace std; int fbnq(int n) { if(n==0) { return 0; } else if(n==1) { return 1; } else { return fbnq(n-1)+fbnq(n-2); } } int main() { int m; cin>>m; cout<<fbnq(m); return 0; }