记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:9:20: error: initializer fails to determine size of 'fib'
    9 |         int *fib[]=new int[n];
      |                    ^~~~~~~~~~
foo.cc:9:20: error: array must be initialized with a brace-enclosed initializer
foo.cc:10:16: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   10 |         fib[0]=1;
      |                ^
      |                |
      |                int
foo.cc:11:16: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   11 |         fib[1]=1;
      |                ^
      |                |
      |                int
foo.cc:13:32: error: invalid operands of types 'int*' and 'int*' to binary 'operator+'
   13 |                 fib[i]=fib[i-1]+fib[i-2];
      |                        ~~~~~~~~^~~~~~~~~
      |                               |        |
      |                               int*     int*
foo.cc:15:23: error: 'a' was not declared in this scope
   15 |                 cout<<a[i]<<" ";
      |                       ^
foo.cc:17:21: error: expected primary-expression before ']' token
   17 |         delete *fib[]
      |                     ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
A2-2 循环结构入门:斐波拉契数列
语言
C++
递交时间
2023-11-26 16:00:00
评测时间
2023-11-26 16:00:56
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes