记录详情

Compile Error

foo.c: In function 'isPrime':
foo.c:3:24: error: 'false' undeclared (first use in this function)
    3 |     if (n <= 1) return false;
      |                        ^~~~~
foo.c:2:1: note: 'false' is defined in header '<stdbool.h>'; did you forget to '#include <stdbool.h>'?
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | int isPrime(int n) {
foo.c:3:24: note: each undeclared identifier is reported only once for each function it appears in
    3 |     if (n <= 1) return false;
      |                        ^~~~~
foo.c:7:12: error: 'true' undeclared (first use in this function)
    7 |     return true;
      |            ^~~~
foo.c:7:12: note: 'true' is defined in header '<stdbool.h>'; did you forget to '#include <stdbool.h>'?
foo.c:17:5: warning: 'main' is normally a non-static function [-Wmain]
   17 | int main() {
      |     ^~~~
foo.c:38:1: error: expected declaration or statement at end of input
   38 | }
      | ^
foo.c:39: warning: control reaches end of non-void function [-Wreturn-type]
foo.c: At top level:
foo.c:17:5: warning: 'main' defined but not used [-Wunused-function]
   17 | int main() {
      |     ^~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
A9-1 数组中的素数个数
比赛
2023年新生赛(第三场)
语言
C
递交时间
2023-09-09 20:57:50
评测时间
2023-09-09 20:57:50
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes