ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#211797 | #4. 爬楼梯 | mumumu111 | Compile Error | / | / | C++ | 246b | 2024-10-03 15:33:17 | 2024-10-03 15:33:18 |
answer
#include <iostream>
using namespace std;
int fib[10000001] = {1, 1, 2, 3, 5, 8, 13, 21, 34};
int fibo(int n){
if (a[n]) return a[n]
return fib[n] = fibo(n-1)+fibo(n-2);
}
int main(){
int a;
cin >> a;
cout << fibo(a);
return 0;
}
详细
answer.code: In function 'int fibo(int)': answer.code:5:6: error: 'a' was not declared in this scope if (a[n]) return a[n]\x0d ^ answer.code:6:2: error: expected ';' before 'return' return fib[n] = fibo(n-1)+fibo(n-2);\x0d ^