/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int main()':
foo.cpp:13:18: error: reference to 'max' is ambiguous
         if (b[i]>max && b[i]>=8) 
                  ^
foo.cpp:3:5: note: candidates are: int max
 int max=0,j=0,a[10][4]={0},b[1000]={0},i;
     ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\mingw32\bits\stdc++.h:64,
                 from foo.cpp:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:4259:5: note:                 template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:4254:5: note:                 template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)
     max(initializer_list<_Tp> __l)
     ^
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++\istream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\sstream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\complex:45,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ccomplex:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\mingw32\bits\stdc++.h:52,
                 from foo.cpp:1:
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:15:10: error: reference to 'max' is ambiguous
          max=b[i]; 
          ^
foo.cpp:3:5: note: candidates are: int max
 int max=0,j=0,a[10][4]={0},b[1000]={0},i;
     ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\mingw32\bits\stdc++.h:64,
                 from foo.cpp:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:4259:5: note:                 template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:4254:5: note:                 template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)
     max(initializer_list<_Tp> __l)
     ^
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++\istream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\sstream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\complex:45,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ccomplex:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\mingw32\bits\stdc++.h:52,
                 from foo.cpp:1:
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:19:9: error: reference to 'max' is ambiguous
     if (max==0) 
         ^
foo.cpp:3:5: note: candidates are: int max
 int max=0,j=0,a[10][4]={0},b[1000]={0},i;
     ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62

信息

递交者
类型
递交
题目
P1113 不高兴的津津
语言
C++
递交时间
2016-09-06 13:02:42
评测时间
2016-09-06 13:02:49
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes