Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
47345 | 奚晨瑞 | 斐波那契数列 | C++ | Accepted | 0 MS | 252 KB | 221 | 2024-05-17 15:13:40 |
#include<iostream> using namespace std; int f(int n){ if(n==1){ return 0; } else if(n==2){ return 1; } else{ return f(n-1)+f(n-2); } } int main() { int n; cin>>n; cout<<f(n); return 0; }