记录详情

Runtime Error

foo.c: In function 'main':
foo.c:5:17: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
  int n; scanf("%d",n);
                ~^
foo.c:6:17: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
  int k; scanf("%d",k);
                ~^
foo.c:9:2: warning: statement with no effect [-Wunused-value]
  for(i;i<n;i++)
  ^~~
foo.c:11:11: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
   scanf("%d",a[i]);
          ~^  ~~~~
foo.c:16:2: warning: statement with no effect [-Wunused-value]
  for(m;m<=k-2;m++)
  ^~~
foo.c:5:9: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
  int n; scanf("%d",n);
         ^~~~~~~~~~~~~
foo.c:6:9: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
  int k; scanf("%d",k);
         ^~~~~~~~~~~~~
foo.c:11:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",a[i]);
   ^~~~~~~~~~~~~~~~
foo.c:5:9: warning: 'n' is used uninitialized in this function [-Wuninitialized]
  int n; scanf("%d",n);
         ^~~~~~~~~~~~~
foo.c:6:9: warning: 'k' is used uninitialized in this function [-Wuninitialized]
  int k; scanf("%d",k);
         ^~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Runtime Error Segmentation fault 0ms 256.0 KiB
#2 Runtime Error Segmentation fault 0ms 256.0 KiB
#3 Runtime Error Segmentation fault 0ms 256.0 KiB
#4 Runtime Error Segmentation fault 0ms 296.0 KiB
#5 Runtime Error Segmentation fault 0ms 256.0 KiB

信息

递交者
类型
递交
题目
2-4 点名上前
比赛
2021(四) 作业第一场:秀肌肉
语言
C
递交时间
2021-09-30 14:17:19
评测时间
2021-09-30 14:17:19
评测机
分数
0
总耗时
4ms
峰值内存
296.0 KiB