#486
MinMax0
Să se determine maximul şi minimul valorilor elementelor unui vector.
Problema | MinMax0 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54028824 | Utilizator | |
Fișier | minmax0.cpp | Dimensiune | 360 B |
Data încărcării | 18 Noiembrie 2024, 11:28 | Scor / rezultat | Eroare de compilare |
minmax0.cpp: In function 'int main()': minmax0.cpp:9:9: error: reference to 'min' is ambiguous min=max=v[1] ^ minmax0.cpp:4:41: note: candidates are: int min int x,v[101],i,p,k,y,a,c,b,ok,m,u,n,d,s,min,max; ^ 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 minmax0.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) ^ minmax0.cpp:9:13: error: reference to 'max' is ambiguous min=max=v[1] ^ minmax0.cpp:4:45: note: candidates are: int max int x,v[101],i,p,k,y,a,c,b,ok,m,u,n,d,s,min,max; ^ 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 minmax0.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) ^ minmax0.cpp:10:9: error: expected ';' before 'for' for(i=2;i<=n;i++) ^ minmax0.cpp:10:18: warning: statement has no effect [-Wunused-value] for(i=2;i<=n;i++) ^ minmax0.cpp:10:25: error: expected ';' before ')' token for(i=2;i<=n;i++) ^ minmax0.cpp:15:15: error: reference to 'min' is ambiguous cout<<min<<" "<<max; ^ minmax0.cpp:4:41: note: candidates are: int min int x,v[101],i,p,k,y,a,c,b,ok,m,u,n,d,s,min,max; ^ 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 minmax0.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) ^ minmax0.cpp:15:25: error: reference to 'max' is ambiguous cout<<min<<" "<<max; ^ minmax0.cpp:4:45: note: candidates are: int max int x,v[101],i,p,k,y,a,c,b,ok,m,u,n,d,s,min,max; ^ 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 minmax0.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) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema MinMax0 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ă.