记录详情

Compile Error

foo.c: In function 'min_index':
foo.c:12:15: error: 'min' undeclared (first use in this function)
   12 |   if(array[i]<min)
      |               ^~~
foo.c:12:15: note: each undeclared identifier is reported only once for each function it appears in
foo.c:11:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   11 |  for(int i=1;i<size;i++)
      |  ^~~
foo.c:14:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   14 |   return min;
      |   ^~~~~~
foo.c: In function 'main':
foo.c:18:12: error: 'MAX_SIZE' undeclared (first use in this function)
   18 |  int array[MAX_SIZE],size,index;
      |            ^~~~~~~~
foo.c:18:6: warning: unused variable 'array' [-Wunused-variable]
   18 |  int array[MAX_SIZE],size,index;
      |      ^~~~~
foo.c: In function 'get_array':
foo.c:7:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
    7 |   scanf("%d",&array[i]);
      |   ^~~~~~~~~~~~~~~~~~~~~
foo.c:8:1: warning: control reaches end of non-void function [-Wreturn-type]
    8 | }
      | ^
foo.c: In function 'min_index':
foo.c:15:1: warning: control reaches end of non-void function [-Wreturn-type]
   15 | }
      | ^
foo.c: In function 'main':
foo.c:19:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   19 |  scanf("%d",&size);
      |  ^~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
A9-5 数组中最小值的个数
语言
C
递交时间
2021-12-24 00:14:14
评测时间
2021-12-24 00:14:14
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes