#3543
StringPushPop
Se dă un string s
. Asupra acestuia, se aplică 5
tipuri de operații:
(1, c)
– se adaugă caracterul c
la începutul string-ului(2, c)
– se adaugă caracterul c
la finalul string-ului(3)
– se șterge primul caracter al string-ului(4)
– se șterge ultimul caracter al string-ului(5)
– string-ul se va transforma în răsturnatul săuSă se afișeze string-ul rezultat după cele q
operații.
Problema | StringPushPop | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.01 secunde | Limita memorie |
Total: 1 MB
/
Stivă 1 MB
|
Id soluție | #53396776 | Utilizator | |
Fișier | stringpushpop.cpp | Dimensiune | 655 B |
Data încărcării | 28 Octombrie 2024, 11:52 | Scor / rezultat | Eroare de compilare |
stringpushpop.cpp: In function 'int main()': stringpushpop.cpp:13:18: error: no matching function for call to 'getline(std::istream&, std::deque<char>&)' getline(cin,s); ^ stringpushpop.cpp:13:18: note: candidates are: In file included from /usr/include/stdio.h:934:0, from /usr/include/c++/4.8/cstdio:42, from /usr/include/c++/4.8/ext/string_conversions.h:43, from /usr/include/c++/4.8/bits/basic_string.h:2815, from /usr/include/c++/4.8/string:52, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from stringpushpop.cpp:1: /usr/include/i386-linux-gnu/bits/stdio.h:115:1: note: __ssize_t getline(char**, size_t*, FILE*) getline (char **__lineptr, size_t *__n, FILE *__stream) ^ /usr/include/i386-linux-gnu/bits/stdio.h:115:1: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from stringpushpop.cpp:1: /usr/include/c++/4.8/bits/basic_string.h:2793:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&) getline(basic_istream<_CharT, _Traits>& __is, ^ /usr/include/c++/4.8/bits/basic_string.h:2793:5: note: template argument deduction/substitution failed: stringpushpop.cpp:13:18: note: 'std::deque<char>' is not derived from 'std::basic_string<_CharT, _Traits, _Alloc>' getline(cin,s); ^ In file included from /usr/include/c++/4.8/string:53:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from stringpushpop.cpp:1: /usr/include/c++/4.8/bits/basic_string.tcc:1068:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&, _CharT) getline(basic_istream<_CharT, _Traits>& __in, ^ /usr/include/c++/4.8/bits/basic_string.tcc:1068:5: note: template argument deduction/substitution failed: stringpushpop.cpp:13:18: note: 'std::deque<char>' is not derived from 'std::basic_string<_CharT, _Traits, _Alloc>' getline(cin,s); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema StringPushPop 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ă.