Compile Error

foo.cc: In function 'void f(int)':
foo.cc:9:10: error: return-statement with a value, in function returning 'void' [-fpermissive]
    9 |   return n;
      |          ^
foo.cc:14:10: error: return-statement with a value, in function returning 'void' [-fpermissive]
   14 |   return n;
      |          ^
foo.cc:16:15: error: invalid operands of types 'void' and 'void' to binary 'operator+'
   16 |  return f(n-1)+f(n-2);
      |         ~~~~~~^~~~~~~
      |          |      |
      |          void   void
foo.cc:16:21: error: return-statement with a value, in function returning 'void' [-fpermissive]
   16 |  return f(n-1)+f(n-2);
      |                     ^
foo.cc:18:1: error: a function-definition is not allowed here before '{' token
   18 | {
      | ^
foo.cc:23:1: error: expected '}' at end of input
   23 | }
      | ^
foo.cc:5:1: note: to match this '{'
    5 | {
      | ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
P1911 斐波那契之函数调用
语言
C++
递交时间
2022-02-06 19:43:15
评测时间
2022-02-06 19:43:15
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes