Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
87414 | Kevin | 【基础题】菲波拉契数列 | C++ | Accepted | 0 MS | 260 KB | 237 | 2024-08-10 10:17:05 |
#include<bits/stdc++.h> using namespace std; int a(int n){ if(n==0) return 0; else if(n==1) return 1; else { return a(n-1)+a(n-2); } } int main(){ for(int i=0;i<=20;i++) { cout<<a(i)<<" "; } return 0; }