记录详情

Compile Error

foo.c: In function 'prime':
foo.c:6:20: warning: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
    6 |         for(m=2;m<=sqrt(n);m++)
      |                    ^~~~
foo.c:2:1: note: include '<math.h>' or provide a declaration of 'sqrt'
    1 | #include <stdio.h>
  +++ |+#include <math.h>
    2 | 
foo.c:6:20: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
    6 |         for(m=2;m<=sqrt(n);m++)
      |                    ^~~~
foo.c:6:20: note: include '<math.h>' or provide a declaration of 'sqrt'
/nix/store/dpxy5cr7cm0nch0qvq2qygs9jwnmhiy5-binutils-2.38/bin/ld: /nix/store/7fz6dhhriwv6n4kdg05qi8cwf7mfqza9-glibc-2.35-163/lib/crt1.o: in function `_start':
/build/glibc-2.35/csu/../sysdeps/x86_64/start.S:103: undefined reference to `main'
collect2: error: ld returned 1 exit status
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
A3-2 素数专题:素数判断
语言
C
递交时间
2022-08-15 18:37:54
评测时间
2022-08-15 18:37:54
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes