Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
103853 | 刘慕莀 | 斐波那契数列(递归) | C++ | Accepted | 4 MS | 276 KB | 249 | 2024-12-29 15:31:37 |
#include<bits/stdc++.h> using namespace std; long long l(int n){ if(n==0){ return 0; } if(n==1){ return 1; } if(n==2){ return 1; } return l(n - 1) + l(n - 2); } int main(){ int a; cin>>a; cout << l(a); return 0; }