Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
42565 | 惠子铭 | 斐波那契数列 | C++ | Accepted | 0 MS | 244 KB | 201 | 2024-03-01 16:00:09 |
#include<iostream> using namespace std; int fun(int n) { if(n==1){ return 0; } if(n==2){ return 1; } return fun(n-1)+fun(n-2); } int main() { int n; cin>>n; cout<<fun(n); }