#189
NumarMunte
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 | #54062049 | Utilizator | |
Fișier | numarmunte.cpp | Dimensiune | 870 B |
Data încărcării | 18 Noiembrie 2024, 23:04 | Scor / rezultat | Eroare de compilare |
numarmunte.cpp: In function 'int main()': numarmunte.cpp:9:6: error: reference to 'max' is ambiguous max=0; ^ numarmunte.cpp:3:7: note: candidates are: int max int n,max,nr,i, x, y, j, m, ok, imax, a[11]; ^ 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 numarmunte.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:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ numarmunte.cpp:13:16: error: reference to 'max' is ambiguous if(a[j]>max){ ^ numarmunte.cpp:3:7: note: candidates are: int max int n,max,nr,i, x, y, j, m, ok, imax, a[11]; ^ 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 numarmunte.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:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ numarmunte.cpp:14:11: error: reference to 'max' is ambiguous max=a[j]; ^ numarmunte.cpp:3:7: note: candidates are: int max int n,max,nr,i, x, y, j, m, ok, imax, a[11]; ^ 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 numarmunte.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:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ numarmunte.cpp:23:16: error: expected '}' before 'else' else ok=0;} ^ numarmunte.cpp:31:21: error: expected '}' before 'else' else ok=0;} ^ numarmunte.cpp: At global scope: numarmunte.cpp:36:1: error: expected unqualified-id before 'for' for(x=1;x<=15;++x) ^ numarmunte.cpp:36:9: error: 'x' does not name a type for(x=1;x<=15;++x) ^ numarmunte.cpp:36:15: error: expected unqualified-id before '++' token for(x=1;x<=15;++x) ^ numarmunte.cpp:37:12: error: expected declaration before '}' token a[x]=0;} ^
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ă.