记录详情

Compile Error

foo.c: In function 'main':
foo.c:5:9: warning: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
foo.c:15:33: warning: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
   15 |                         int n = sqrt(h);
      |                                 ^~~~
foo.c:2:1: note: include '<math.h>' or provide a declaration of 'sqrt'
    1 | #include<stdio.h>
  +++ |+#include <math.h>
    2 | int main()
foo.c:15:33: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
   15 |                         int n = sqrt(h);
      |                                 ^~~~
foo.c:15:33: note: include '<math.h>' or provide a declaration of 'sqrt'
foo.c:31:26: warning: format '%d' expects argument of type 'int', but argument 2 has type 'int *' [-Wformat=]
   31 |                 printf("%d",&cent);
      |                         ~^  ~~~~~
      |                          |  |
      |                          |  int *
      |                          int
      |                         %ls
/nix/store/j2gmfdd29cp3rcvghmn1a5kgcnmf8myp-binutils-2.40/bin/ld: /tmp/ccd4X8nS.o: in function `main':
foo.c:(.text.startup+0x11): undefined reference to `scanf_s'
collect2: error: ld returned 1 exit status
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
A5-2 超级素数的个数
语言
C
递交时间
2023-10-01 16:16:51
评测时间
2023-10-01 16:16:51
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes