记录详情

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: In lambda function:
foo.cc:17:18: error: expected '{' before 'fib'
   17 |         delete*[]fib;
      |                  ^~~
foo.cc: In function 'int main()':
foo.cc:17:15: error: cannot delete a function.  Only pointer-to-objects are valid arguments to 'delete'
   17 |         delete*[]fib;
      |               ^~~
[Hydro](https://hydro.ac)提供评测服务

信息

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