记录详情

Wrong Answer

foo.c: In function 'main':
foo.c:19:8: warning: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
  scanf(n,"%d");
        ^
In file included from /usr/include/features.h:424:0,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from foo.c:1:
/usr/include/stdio.h:398:12: note: expected 'const char * restrict' but argument is of type 'int'
 extern int __REDIRECT (scanf, (const char *__restrict __format, ...),
            ^
foo.c:24:9: warning: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
   scanf(a[i],"%d");
         ^
In file included from /usr/include/features.h:424:0,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from foo.c:1:
/usr/include/stdio.h:398:12: note: expected 'const char * restrict' but argument is of type 'int'
 extern int __REDIRECT (scanf, (const char *__restrict __format, ...),
            ^
foo.c:19:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
  scanf(n,"%d");
  ^~~~~~~~~~~~~
foo.c:24:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   scanf(a[i],"%d");
   ^~~~~~~~~~~~~~~~
foo.c:19:2: warning: 'n' is used uninitialized in this function [-Wuninitialized]
  scanf(n,"%d");
  ^~~~~~~~~~~~~
#'target_mem_ref' not supported by expression#'foo.c:8:7: warning:  may be used uninitialized in this function [-Wmaybe-uninitialized]
   if(a[i]>a[iMax])
      ~^~~
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Wrong Answer Read 请输入整数n:/n请输入n个整数..., expect 3. 1ms 256.0 KiB
#2 Wrong Answer Read 请输入整数n:/n请输入n个整数..., expect 3. 0ms 256.0 KiB
#3 Wrong Answer Read 请输入整数n:/n请输入n个整数..., expect 5. 1ms 256.0 KiB
#4 Wrong Answer Read 请输入整数n:/n请输入n个整数..., expect 7. 1ms 256.0 KiB
#5 Wrong Answer Read 请输入整数n:/n请输入n个整数..., expect 7. 0ms 256.0 KiB

信息

递交者
类型
递交
题目
A7-3 数组的极值下标函数
比赛
2021(四) 作业第二场:见面赛
语言
C
递交时间
2021-10-31 12:31:50
评测时间
2021-10-31 12:31:50
评测机
分数
0
总耗时
5ms
峰值内存
256.0 KiB