#4151
Se citește un vector cu n
elemente, numere naturale distincte. Să se afișeze elementele cuprinse între elementul cu valoarea minimă și cel cu valoare maximă din vector, inclusiv acestea.
Problema | AMM | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #49575477 | Utilizator | |
Fișier | amm.cpp | Dimensiune | 592 B |
Data încărcării | 07 Martie 2024, 15:47 | Scor / rezultat | Eroare de compilare |
amm.cpp:28:24: error: empty character constant cout<<[i]<<''; ^ amm.cpp:33:24: error: empty character constant cout<<[i]<<''; ^ amm.cpp: In lambda function: amm.cpp:28:22: error: expected '{' before '<<' token cout<<[i]<<''; ^ amm.cpp: In function 'int main()': amm.cpp:28:22: error: cannot bind 'std::ostream {aka std::basic_ostream<char>}' lvalue to 'std::basic_ostream<char>&&' In file included from /usr/include/c++/4.8/iostream:39:0, from amm.cpp:1: /usr/include/c++/4.8/ostream:602:5: error: initializing argument 1 of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = main()::__lambda0]' operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x) ^ amm.cpp: In lambda function: amm.cpp:33:22: error: expected '{' before '<<' token cout<<[i]<<''; ^ amm.cpp: In function 'int main()': amm.cpp:33:22: error: cannot bind 'std::ostream {aka std::basic_ostream<char>}' lvalue to 'std::basic_ostream<char>&&' In file included from /usr/include/c++/4.8/iostream:39:0, from amm.cpp:1: /usr/include/c++/4.8/ostream:602:5: error: initializing argument 1 of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = main()::__lambda1]' operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x) ^ amm.cpp:7:44: warning: unused variable 'j' [-Wunused-variable] int n,i,imin=99999,imax=-99999,ma,mi,x,j,v[1000]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema AMM 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ă.