Borderou de evaluare (job #1768230)

Utilizator NashikAndrei Feodorov Nashik Data 30 septembrie 2016 16:04:02
Problema Expresie Status done
Runda Arhiva de probleme Compilator cpp | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: user.cpp: In function ‘int main()’: user.cpp:17:24: error: no matching function for call to ‘max(<unresolved overloaded function type>, int&)’ max=max(max,sum); ^ user.cpp:17:24: note: candidates are: In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from user.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int] max(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: no known conversion for argument 1 from ‘<unresolved overloaded function type>’ to ‘const int&’ /usr/include/c++/4.8/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) ^ /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template argument deduction/substitution failed: user.cpp:17:24: note: candidate expects 3 arguments, 2 provided max=max(max,sum); ^ user.cpp:21:13: error: ‘j’ was not declared in this scope for(j=i+1;j<=n-1;j++) ^ user.cpp:25:28: error: no matching function for call to ‘max(<unresolved overloaded function type>, int&)’ max=max(max,sum); ^ user.cpp:25:28: note: candidates are: In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from user.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int] max(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: no known conversion for argument 1 from ‘<unresolved overloaded function type>’ to ‘const int&’ /usr/include/c++/4.8/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) ^ /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template argument deduction/substitution failed: user.cpp:25:28: note: candidate expects 3 arguments, 2 provided max=max(max,sum); ^ user.cpp:28:9: error: no match for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream<char>}’ and ‘<unresolved overloaded function type>’) cout<<max; ^ user.cpp:28:9: note: candidates are: In file included from /usr/include/c++/4.8/iostream:39:0, from user.cpp:1:

Ceva nu functioneaza?