记录详情

Compile Error

foo.cc:3:36: error: 'int index' redeclared as different kind of symbol
 int n, a[10005], maxn = -0x3f3f3f, index;
                                    ^~~~~
In file included from /usr/include/string.h:431:0,
                 from /usr/include/c++/7/cstring:42,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:48,
                 from foo.cc:1:
/usr/include/strings.h:61:1: note: previous declaration 'const char* index(const char*, int)'
 index (const char *__s, int __c) __THROW
 ^~~~~
foo.cc: In function 'int main()':
foo.cc:9:25: error: overloaded function with no contextual type information
    maxn = a[i]; index = i;
                         ^
foo.cc:12:22: error: overloaded function with no contextual type information
  printf("%d\n", index);
                      ^
foo.cc:5:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
  ~~~~~^~~~~~~~~~
foo.cc:6:35: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
                              ~~~~~^~~~~~~~~~~~~
自豪的采用HydroJudge(https://github.com/hydro-dev/Hydro)进行评测。

信息

递交者
类型
递交
比赛
2020苏青奥赛集训营(2021-3-7课后作业)
语言
C++
递交时间
2021-03-08 14:05:02
评测时间
2021-03-08 14:05:02
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes