#2750
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 |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #52232648 | Utilizator | |
Fișier | gennr.cpp | Dimensiune | 671 B |
Data încărcării | 24 Septembrie 2024, 09:16 | Scor / rezultat | Eroare de compilare |
gennr.cpp:4:27: error: 'INT_MAX' was not declared in this scope long long x, y, a, b, min=INT_MAX, max=INT_MIN, yy; ^ gennr.cpp: In function 'int main()': gennr.cpp:8:9: error: overloaded function with no contextual type information max = 0; ^ gennr.cpp:9:5: error: reference to 'min' is ambiguous min = 100; ^ gennr.cpp:4:23: note: candidates are: long long int min long long x, y, a, b, min=INT_MAX, max=INT_MIN, yy; ^ 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:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ gennr.cpp:12:9: error: 'yy' was not declared in this scope yy = y; ^ gennr.cpp:17:48: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator>' if (a * 10 + b > 9 && a * 10 + b > max) max = a * 10 + b; ^ gennr.cpp:17:57: error: overloaded function with no contextual type information if (a * 10 + b > 9 && a * 10 + b > max) max = a * 10 + b; ^ gennr.cpp:18:48: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator>' if (b * 10 + a > 9 && b * 10 + a > max) max = b * 10 + a; ^ gennr.cpp:18:57: error: overloaded function with no contextual type information if (b * 10 + a > 9 && b * 10 + a > max) max = b * 10 + a; ^ gennr.cpp:19:48: error: reference to 'min' is ambiguous if (a * 10 + b > 9 && a * 10 + b < min) min = a * 10 + b; ^ gennr.cpp:4:23: note: candidates are: long long int min long long x, y, a, b, min=INT_MAX, max=INT_MIN, yy; ^ 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:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ gennr.cpp:19:53: error: reference to 'min' is ambiguous if (a * 10 + b > 9 && a * 10 + b < min) min = a * 10 + b; ^ gennr.cpp:4:23: note: candidates are: long long int min long long x, y, a, b, min=INT_MAX, max=INT_MIN, yy; ^ 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:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ gennr.cpp:20:48: error: reference to 'min' is ambiguous if (b * 10 + a > 9 && b * 10 + a < min) min = b * 10 + a; ^ gennr.cpp:4:23: note: candidates are: long long int min long long x, y, a, b, min=INT_MAX, max=INT_MIN, yy; ^ 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:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ gennr.cpp:20:53: error: reference to 'min' is ambiguous if (b * 10 + a > 9 && b * 10 + a < min) min = b * 10 + a; ^ gennr.cpp:4:23: note: candidates are: long long int min long long x, y, a, b, min=INT_MAX, max=INT_MIN, yy; ^ 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:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ gennr.cpp:25:13: error: reference to 'min' is ambiguous cout << min << ' ' << max; ^ gennr.cpp:4:23: note: candidates are: long long int min long long x, y, a, b, min=INT_MAX, max=INT_MIN, yy; ^ 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:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^
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ă.