Compile Error
foo.cc: In function ‘int feb(int)’:
foo.cc:4:5: error: lvalue required as left operand of assignment
4 | feb(1)=1;
| ~~~^~~
foo.cc:5:5: error: lvalue required as left operand of assignment
5 | feb(2)=1;
| ~~~^~~
foo.cc: In function ‘int main()’:
foo.cc:13:19: error: ‘sum’ was not declared in this scope
13 | if(i>=k1) sum+=feb(i);
| ^~~
foo.cc:15:15: error: ‘sum’ was not declared in this scope
15 | cout<<sum;
| ^~~
信息
- 递交者
- 类型
- 递交
- 题目
- 1-2 斐波那契数列的和
- 语言
- C++
- 递交时间
- 2025-08-14 16:25:24
- 评测时间
- 2025-08-14 16:25:24
- 评测机
- 分数
- 0
- 总耗时
- 0ms
- 峰值内存
- 0 Bytes