记录详情

Runtime Error

foo.c: In function 'Selinter':
foo.c:9:29: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    9 |                         if (a[i] = b[j])
      |                             ^
foo.c:13:38: warning: statement with no effect [-Wunused-value]
   13 |                                 c[m] == a[i];
      |                                 ~~~~~^~~~~~~
foo.c:4:26: warning: unused variable 'f' [-Wunused-variable]
    4 |         int i, j, m = 0, f, c[1000];
      |                          ^
foo.c: In function 'main':
foo.c:33:33: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
   33 |                         scanf("%d", b[q]);
      |                                ~^   ~~~~
      |                                 |    |
      |                                 |    int
      |                                 int *
foo.c:37:30: warning: comparison between pointer and integer
   37 |                         c[i] == Selinter;
      |                              ^~
foo.c:37:30: warning: statement with no effect [-Wunused-value]
   37 |                         c[i] == Selinter;
      |                         ~~~~~^~~~~~~~~~~
foo.c:45:33: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
   45 |                         scanf("%d", d[n]);
      |                                ~^   ~~~~
      |                                 |    |
      |                                 |    int
      |                                 int *
foo.c: In function 'Selinter':
foo.c:21:17: warning: 'c' is used uninitialized [-Wuninitialized]
   21 |         return c[m];
      |                ~^~~
foo.c:4:29: note: 'c' declared here
    4 |         int i, j, m = 0, f, c[1000];
      |                             ^
foo.c: In function 'main':
foo.c:33:25: warning: 'b' may be used uninitialized [-Wmaybe-uninitialized]
   33 |                         scanf("%d", b[q]);
      |                         ^~~~~~~~~~~~~~~~~
foo.c:25:22: note: 'b' declared here
   25 |         int a[1000], b[1000], c[1000],d[1000];
      |                      ^
foo.c:45:25: warning: 'd' may be used uninitialized [-Wmaybe-uninitialized]
   45 |                         scanf("%d", d[n]);
      |                         ^~~~~~~~~~~~~~~~~
foo.c:25:39: note: 'd' declared here
   25 |         int a[1000], b[1000], c[1000],d[1000];
      |                                       ^
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Runtime Error Segmentation fault 2ms 284.0 KiB
#2 Runtime Error Segmentation fault 1ms 328.0 KiB
#3 Runtime Error Segmentation fault 2ms 284.0 KiB
#4 Runtime Error Segmentation fault 2ms 332.0 KiB
#5 Runtime Error Segmentation fault 1ms 284.0 KiB

信息

递交者
类型
递交
题目
A10-4 集合的交集
比赛
2023 程序设计与竞赛(作业5:从数组看集体)
语言
C
递交时间
2023-10-21 23:53:06
评测时间
2023-10-21 23:53:06
评测机
分数
0
总耗时
11ms
峰值内存
332.0 KiB