#3980
MinPlusMax
Se citește un număr natural nenul n
și apoi se citesc n
numere naturale. Calculați suma dintre valoarea minimă și valoarea maximă.
Problema | MinPlusMax | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53638742 | Utilizator | |
Fișier | minplusmax.cpp | Dimensiune | 243 B |
Data încărcării | 07 Noiembrie 2024, 09:00 | Scor / rezultat | Eroare de compilare |
minplusmax.cpp: In function 'int main()': minplusmax.cpp:11:14: error: no matching function for call to 'max(int&)' M = max(x); ^ minplusmax.cpp:11:14: 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 minplusmax.cpp:1: /usr/include/c++/4.8/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) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template argument deduction/substitution failed: minplusmax.cpp:11:14: note: candidate expects 2 arguments, 1 provided M = max(x); ^ 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 minplusmax.cpp:1: /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: minplusmax.cpp:11:14: note: candidate expects 3 arguments, 1 provided M = max(x); ^ minplusmax.cpp:12:14: error: no matching function for call to 'min(int&)' m = min(x); ^ minplusmax.cpp:12:14: 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 minplusmax.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template argument deduction/substitution failed: minplusmax.cpp:12:14: note: candidate expects 2 arguments, 1 provided m = min(x); ^ 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 minplusmax.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template argument deduction/substitution failed: minplusmax.cpp:12:14: note: candidate expects 3 arguments, 1 provided m = min(x); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MinPlusMax face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.