记录详情

Compile Error

foo.c: In function ‘main’:
foo.c:6:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
    6 |    int f{20}={1,1};
      |         ^
foo.c:6:10: warning: statement with no effect [-Wunused-value]
    6 |    int f{20}={1,1};
      |          ^~
foo.c:6:12: error: expected ‘;’ before ‘}’ token
    6 |    int f{20}={1,1};
      |            ^
      |            ;
foo.c:6:13: error: expected expression before ‘=’ token
    6 |    int f{20}={1,1};
      |             ^
foo.c:7:11: warning: right-hand operand of comma expression has no effect [-Wunused-value]
    7 |    for(i=0,i<20,i++)
      |           ^
foo.c:7:20: error: expected ‘;’ before ‘)’ token
    7 |    for(i=0,i<20,i++)
      |                    ^
      |                    ;
foo.c:7:20: error: expected expression before ‘)’ token
foo.c:8:12: error: ‘f’ undeclared (first use in this function)
    8 |            f{i}=f{i-1}+{i-2};
      |            ^
foo.c:8:12: note: each undeclared identifier is reported only once for each function it appears in
foo.c:8:13: error: expected ‘;’ before ‘{’ token
    8 |            f{i}=f{i-1}+{i-2};
      |             ^
      |             ;
foo.c:9:25: error: expected ‘)’ before ‘}’ token
    9 |         for(i=0;i<20;i++};
      |            ~            ^
      |                         )
foo.c:9:25: error: expected expression before ‘}’ token
foo.c: At top level:
foo.c:10:9: error: expected identifier or ‘(’ before ‘{’ token
   10 |         {
      |         ^
foo.c:14:11: error: expected declaration specifiers or ‘...’ before string constant
   14 |    printf("\n");
      |           ^~~~
foo.c:15:4: error: expected identifier or ‘(’ before ‘return’
   15 |    return 0:
      |    ^~~~~~

信息

递交者
类型
递交
题目
P1005 斐波那契数列
语言
C
递交时间
2024-08-18 15:40:36
评测时间
2024-08-18 15:40:36
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes