记录详情

Compile Error

foo.c: In function 'maxs':
foo.c:7:14: error: 'k' undeclared (first use in this function)
    7 |   if(a[i]>0&&k==0)
      |              ^
foo.c:7:14: note: each undeclared identifier is reported only once for each function it appears in
foo.c:8:4: error: 'min' undeclared (first use in this function)
    8 |    min=a[i],k++;
      |    ^~~
foo.c:8:12: warning: left-hand operand of comma expression has no effect [-Wunused-value]
    8 |    min=a[i],k++;
      |            ^
foo.c:11:12: warning: left-hand operand of comma expression has no effect [-Wunused-value]
   11 |    min=a[i],j=i;
      |            ^
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",&n1);
      |  ^~~~~~~~~~~~~~~
foo.c:20:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   20 |   scanf("%d",&n2);
      |   ^~~~~~~~~~~~~~~
foo.c:22:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   22 |   scanf("%d",&a[i]);
      |   ^~~~~~~~~~~~~~~~~
foo.c:24:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   24 |   scanf("%d",&b[i]);
      |   ^~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
A9-2 数组中最小正数的下标
语言
C
递交时间
2021-12-23 17:11:52
评测时间
2021-12-23 17:11:52
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes