#189
Să se verifice dacă un număr este de tip “munte”.
| Problema | NumarMunte | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64667052 | Utilizator | |
| Fișier | numarmunte.cpp | Dimensiune | 927 B |
| Data încărcării | 21 Mai 2026, 12:51 | Scor/rezultat | Eroare de compilare |
numarmunte.cpp: In function ‘bool munte(int)’: numarmunte.cpp:32:38: error: no matching function for call to ‘pow(int)’ 32 | if(t%int(pow(i,10))>t%int(pow(i+1))) continue; | ~~~^~~~~ In file included from numarmunte.cpp:2: /usr/include/c++/13/cmath:1070:5: note: candidate: ‘template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up)’ 1070 | pow(_Tp __x, _Up __y) | ^~~ /usr/include/c++/13/cmath:1070:5: note: template argument deduction/substitution failed: numarmunte.cpp:32:38: note: candidate expects 2 arguments, 1 provided 32 | if(t%int(pow(i,10))>t%int(pow(i+1))) continue; | ~~~^~~~~ In file included from /usr/include/features.h:502, from /usr/include/x86_64-linux-gnu/c++/13/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/13/bits/c++config.h:679, from /usr/include/c++/13/bits/requires_hosted.h:31, from /usr/include/c++/13/iostream:38, from numarmunte.cpp:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:140:1: note: candidate: ‘double pow(double, double)’ 140 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y)); | ^~~~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/bits/mathcalls.h:140:1: note: candidate expects 2 arguments, 1 provided /usr/include/c++/13/cmath:376:3: note: candidate: ‘constexpr long double std::pow(long double, long double)’ 376 | pow(long double __x, long double __y) | ^~~ /usr/include/c++/13/cmath:376:3: note: candidate expects 2 arguments, 1 provided /usr/include/c++/13/cmath:372:3: note: candidate: ‘constexpr float std::pow(float, float)’ 372 | pow(float __x, float __y) | ^~~ /usr/include/c++/13/cmath:372:3: note: candidate expects 2 arguments, 1 provided
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NumarMunte 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ă.