#238
Zone
Se dă un număr natural n
şi un tablou unidimensional cu 3*n
elemente, numere naturale cu cel mult 4 cifre. Tabloul este împărţit în trei zone, cu câte n
elemente: prima zonă conţine primele n
elemente din tablou, a doua zonă conţine următoarele n
elemente din tablou, restul elementelor fiind în zona a treia.
Se cere interschimbarea primulul element par (dacă există) al zonei unu cu ultimul element impar (dacă există) al zonei trei. În cazul în care unul dintre elementele care urmează a fi interschimbate nu există, tabloul rămâne nemodificat.
Variante Bacalaureat 2009
Problema | Zone | Operații I/O |
zone.in /zone.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54537263 | Utilizator | |
Fișier | zone.cpp | Dimensiune | 814 B |
Data încărcării | 01 Decembrie 2024, 23:07 | Scor / rezultat | Eroare de compilare |
zone.cpp: In function 'int main()': zone.cpp:19:19: error: use of deleted function 'std::basic_ifstream<char>::basic_ifstream(const std::basic_ifstream<char>&)' citire(v,n,fin); ^ In file included from zone.cpp:2:0: /usr/include/c++/4.8/fstream:427:11: note: 'std::basic_ifstream<char>::basic_ifstream(const std::basic_ifstream<char>&)' is implicitly deleted because the default definition would be ill-formed: class basic_ifstream : public basic_istream<_CharT, _Traits> ^ /usr/include/c++/4.8/fstream:427:11: error: use of deleted function 'std::basic_istream<char>::basic_istream(const std::basic_istream<char>&)' In file included from /usr/include/c++/4.8/iostream:40:0, from zone.cpp:1: /usr/include/c++/4.8/istream:58:11: note: 'std::basic_istream<char>::basic_istream(const std::basic_istream<char>&)' is implicitly deleted because the default definition would be ill-formed: class basic_istream : virtual public basic_ios<_CharT, _Traits> ^ /usr/include/c++/4.8/istream:58:11: error: use of deleted function 'std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)' In file included from /usr/include/c++/4.8/ios:44:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from zone.cpp:1: /usr/include/c++/4.8/bits/basic_ios.h:66:11: note: 'std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)' is implicitly deleted because the default definition would be ill-formed: class basic_ios : public ios_base ^ In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from zone.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:792:5: error: 'std::ios_base::ios_base(const std::ios_base&)' is private ios_base(const ios_base&); ^ In file included from /usr/include/c++/4.8/ios:44:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from zone.cpp:1: /usr/include/c++/4.8/bits/basic_ios.h:66:11: error: within this context class basic_ios : public ios_base ^ In file included from zone.cpp:2:0: /usr/include/c++/4.8/fstream:427:11: error: use of deleted function 'std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)' class basic_ifstream : public basic_istream<_CharT, _Traits> ^ /usr/include/c++/4.8/fstream:427:11: error: use of deleted function 'std::basic_filebuf<char>::basic_filebuf(const std::basic_filebuf<char>&)' /usr/include/c++/4.8/fstream:72:11: note: 'std::basic_filebuf<char>::basic_filebuf(const std::basic_filebuf<char>&)' is implicitly deleted because the default definition would be ill-formed: class basic_filebuf : public basic_streambuf<_CharT, _Traits> ^ In file included from /usr/include/c++/4.8/ios:43:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from zone.cpp:1: /usr/include/c++/4.8/streambuf:802:7: error: 'std::basic_streambuf<_CharT, _Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]' is private basic_streambuf(const basic_streambuf& __sb) ^ In file included from zone.cpp:2:0: /usr/include/c++/4.8/fstream:72:11: error: within this context class basic_filebuf : public basic_streambuf<_CharT, _Traits> ^ zone.cpp:4:6: error: initializing argument 3 of 'void citire(int*, int, std::ifstream)' void citire(int v[101],int n, ifstream fin) { ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Zone 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ă.