#2750
GenNr
C++
Se citesc două numere naturale. Să se afișeze cel mai mic și cel mai mare număr format din exact două cifre, scris cu o cifră din primul număr și cu o cifră din cel de-al doilea.
Problema | GenNr | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #49796710 | Utilizator | |
Fișier | gennr.cpp | Dimensiune | 770 B |
Data încărcării | 15 Martie 2024, 09:22 | Scor / rezultat | Eroare de compilare |
gennr.cpp: In function 'int cmax(long long int)': gennr.cpp:20:41: error: no matching function for call to 'max(long long int, int)' else return max(x % 10, cmax(x / 10)); ^ gennr.cpp:20:41: 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 gennr.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: gennr.cpp:20:41: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') else return max(x % 10, cmax(x / 10)); ^ 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 gennr.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: gennr.cpp:20:41: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') else return max(x % 10, cmax(x / 10)); ^ gennr.cpp: In function 'int cmin(long long int)': gennr.cpp:25:41: error: no matching function for call to 'min(long long int, int)' else return min(x % 10, cmin(x / 10)); ^ gennr.cpp:25:41: 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 gennr.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: gennr.cpp:25:41: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') else return min(x % 10, cmin(x / 10)); ^ 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 gennr.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: gennr.cpp:25:41: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') else return min(x % 10, cmin(x / 10)); ^ gennr.cpp: In function 'int cmax(long long int)': gennr.cpp:21:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ gennr.cpp: In function 'int cmin(long long int)': gennr.cpp:26:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GenNr 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ă.