记录详情

Compile Error

foo.c:2:6: warning: return type of 'main' is not 'int' [-Wmain]
    2 | void main()
      |      ^~~~
foo.c: In function 'main':
foo.c:5:5: error: unknown type name 'bool'
    5 |     bool trees[10001];
      |     ^~~~
foo.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; did you forget to '#include <stdbool.h>'?
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | void main()
foo.c:7:20: error: 'true' undeclared (first use in this function)
    7 |         trees[i] = true;
      |                    ^~~~
foo.c:7:20: note: 'true' is defined in header '<stdbool.h>'; did you forget to '#include <stdbool.h>'?
foo.c:7:20: note: each undeclared identifier is reported only once for each function it appears in
foo.c:13:24: error: 'false' undeclared (first use in this function)
   13 |             trees[j] = false;
      |                        ^~~~~
foo.c:13:24: note: 'false' is defined in header '<stdbool.h>'; did you forget to '#include <stdbool.h>'?
foo.c:16:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   16 |     for(i = 0;i <= L; i++)
      |     ^~~
foo.c:18:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   18 |         printf("%d\n", count);
      |         ^~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1007 校门外的树
语言
C
递交时间
2023-08-23 15:53:03
评测时间
2023-08-23 15:53:03
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes