/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int main()':
foo.cpp:22:2: error: reference to 'max' is ambiguous
  max = 0;
  ^
foo.cpp:9:14: note: candidates are: int max
 int i, j, n, max, sum, asd, code;
              ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:2:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:260:5: note:                 template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:216:5: note:                 template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^
foo.cpp:59:16: error: reference to 'max' is ambiguous
   if (sch[i] > max)
                ^
foo.cpp:9:14: note: candidates are: int max
 int i, j, n, max, sum, asd, code;
              ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:2:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:260:5: note:                 template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:216:5: note:                 template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^
foo.cpp:61:4: error: reference to 'max' is ambiguous
    max = sch[i];
    ^
foo.cpp:9:14: note: candidates are: int max
 int i, j, n, max, sum, asd, code;
              ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\char_traits.h:39:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:40,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:2:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:260:5: note:                 template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algobase.h:216:5: note:                 template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^

信息

递交者
类型
递交
题目
P1001 谁拿了最多奖学金
语言
C++
递交时间
2016-10-01 16:33:31
评测时间
2016-10-01 16:33:32
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes