记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:9:22: error: initializer fails to determine size of 'fib'
  int *fib[]=new int[n];
                      ^
/in/foo.cc:9:22: error: array must be initialized with a brace-enclosed initializer
/in/foo.cc:10:9: error: invalid conversion from 'int' to 'int*' [-fpermissive]
  fib[0]=1;
         ^
/in/foo.cc:11:9: error: invalid conversion from 'int' to 'int*' [-fpermissive]
  fib[1]=1;
         ^
/in/foo.cc:13:18: error: invalid operands of types 'int*' and 'int*' to binary 'operator+'
   fib[i]=fib[i-1]+fib[i-2];
          ~~~~~~~~^~~~~~~~~
/in/foo.cc:15:9: error: 'a' was not declared in this scope
   cout<<a[i]<<" ";
         ^
/in/foo.cc:17:10: warning: deleting array 'fib'
  delete[]fib;
          ^~~

信息

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