#3254
prod_pi
Se dă un număr natural n
cu cel puțin două cifre, care conține atât cifre pare cât și cifre impare. Calculați produsul dintre cea mai mare cifră pară și cea mai mică cifră impară a lui n
.
Problema | prod_pi | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54659203 | Utilizator | |
Fișier | prod_pi.cpp | Dimensiune | 422 B |
Data încărcării | 04 Decembrie 2024, 19:50 | Scor / rezultat | Eroare de compilare |
prod_pi.cpp: In function 'int main()': prod_pi.cpp:12:43: error: no matching function for call to 'max(long long int&, int&)' max_para = max(max_para, cifra); ^ prod_pi.cpp:12:43: 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 prod_pi.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: prod_pi.cpp:12:43: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') max_para = max(max_para, cifra); ^ 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 prod_pi.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: prod_pi.cpp:12:43: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') max_para = max(max_para, cifra); ^ prod_pi.cpp:14:47: error: no matching function for call to 'min(long long int&, int&)' min_impara = min(min_impara, cifra); ^ prod_pi.cpp:14:47: 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 prod_pi.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: prod_pi.cpp:14:47: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') min_impara = min(min_impara, cifra); ^ 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 prod_pi.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: prod_pi.cpp:14:47: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') min_impara = min(min_impara, cifra); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema prod_pi 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ă.