记录详情

Runtime Error

foo.c: In function 'Output':
foo.c:6:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'int *' [-Wformat=]
    6 |         printf("%d ", &a[i]);
      |                 ~^    ~~~~~
      |                  |    |
      |                  int  int *
      |                 %ls
foo.c: In function 'main':
foo.c:13:13: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
   13 |     scanf("%d", n);
      |            ~^   ~
      |             |   |
      |             |   int
      |             int *
foo.c:15:17: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
   15 |         scanf("%d", a[i]);
      |                ~^   ~~~~
      |                 |    |
      |                 |    int
      |                 int *
foo.c:16:12: warning: passing argument 1 of 'Output' makes integer from pointer without a cast [-Wint-conversion]
   16 |     Output(a, n);
      |            ^
      |            |
      |            int *
foo.c:3:16: note: expected 'int' but argument is of type 'int *'
    3 | int Output(int n, int a[])
      |            ~~~~^
foo.c:16:15: warning: passing argument 2 of 'Output' makes pointer from integer without a cast [-Wint-conversion]
   16 |     Output(a, n);
      |               ^
      |               |
      |               int
foo.c:3:23: note: expected 'int *' but argument is of type 'int'
    3 | int Output(int n, int a[])
      |                   ~~~~^~~
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Runtime Error Segmentation fault 2ms 284.0 KiB
#2 Runtime Error Segmentation fault 2ms 328.0 KiB
#3 Runtime Error Segmentation fault 2ms 284.0 KiB
#4 Runtime Error Segmentation fault 1ms 412.0 KiB
#5 Runtime Error Segmentation fault 2ms 412.0 KiB

信息

递交者
类型
递交
题目
A7-1 数组的输出函数
语言
C
递交时间
2023-12-12 14:08:51
评测时间
2023-12-12 14:08:51
评测机
分数
0
总耗时
11ms
峰值内存
412.0 KiB