记录详情

Runtime Error

foo.c: In function 'main':
foo.c:6:15: warning: passing argument 1 of 'scanf' from incompatible pointer type [-Wincompatible-pointer-types]
    6 |         scanf(&n);
      |               ^~
      |               |
      |               int *
In file included from foo.c:1:
/nix/store/3w4yrspgcx1z9wi18rv0hbap4jjlhx4c-glibc-2.37-8-dev/include/stdio.h:421:42: note: expected 'const char * restrict' but argument is of type 'int *'
  421 | extern int scanf (const char *__restrict __format, ...) __wur;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
foo.c:7:13: warning: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
    7 |     printf(n-1);
      |            ~^~
      |             |
      |             int
/nix/store/3w4yrspgcx1z9wi18rv0hbap4jjlhx4c-glibc-2.37-8-dev/include/stdio.h:356:43: note: expected 'const char * restrict' but argument is of type 'int'
  356 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
foo.c:6:9: warning: 'n' is used uninitialized [-Wuninitialized]
    6 |         scanf(&n);
      |         ^~~~~~~~~
In file included from /nix/store/3w4yrspgcx1z9wi18rv0hbap4jjlhx4c-glibc-2.37-8-dev/include/features.h:491,
                 from /nix/store/3w4yrspgcx1z9wi18rv0hbap4jjlhx4c-glibc-2.37-8-dev/include/bits/libc-header-start.h:33,
                 from /nix/store/3w4yrspgcx1z9wi18rv0hbap4jjlhx4c-glibc-2.37-8-dev/include/stdio.h:27:
/nix/store/3w4yrspgcx1z9wi18rv0hbap4jjlhx4c-glibc-2.37-8-dev/include/stdio.h:437:12: note: by argument 1 of type 'const char * restrict' to 'scanf' declared here
  437 | extern int __REDIRECT (scanf, (const char *__restrict __format, ...),
      |            ^~~~~~~~~~
foo.c:5:13: note: 'n' declared here
    5 |         int n;
      |             ^
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Runtime Error Segmentation fault 2ms 284.0 KiB
#2 Runtime Error Segmentation fault 2ms 284.0 KiB
#3 Runtime Error Segmentation fault 2ms 284.0 KiB
#4 Runtime Error Segmentation fault 1ms 284.0 KiB
#5 Runtime Error Segmentation fault 2ms 284.0 KiB
#6 Runtime Error Segmentation fault 1ms 284.0 KiB
#7 Runtime Error Segmentation fault 2ms 284.0 KiB
#8 Runtime Error Segmentation fault 1ms 284.0 KiB
#9 Runtime Error Segmentation fault 2ms 284.0 KiB
#10 Runtime Error Segmentation fault 1ms 284.0 KiB
#11 Runtime Error Segmentation fault 1ms 284.0 KiB
#12 Runtime Error Segmentation fault 1ms 284.0 KiB
#13 Runtime Error Segmentation fault 2ms 284.0 KiB
#14 Runtime Error Segmentation fault 1ms 284.0 KiB
#15 Runtime Error Segmentation fault 1ms 284.0 KiB
#16 Runtime Error Segmentation fault 1ms 332.0 KiB
#17 Runtime Error Segmentation fault 1ms 284.0 KiB
#18 Runtime Error Segmentation fault 1ms 284.0 KiB
#19 Runtime Error Segmentation fault 1ms 284.0 KiB
#20 Runtime Error Segmentation fault 1ms 284.0 KiB

信息

递交者
类型
递交
题目
P1002 硕哥的最短路
语言
C
递交时间
2023-08-23 12:22:26
评测时间
2023-08-23 12:22:26
评测机
分数
0
总耗时
38ms
峰值内存
332.0 KiB