记录详情

Compile Error

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

信息

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