#88
Palindrom
Să se verifice dacă un cuvânt dat este palindrom.
Problema | Palindrom | Operații I/O |
![]() palindrom.in /palindrom.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #20639838 | Utilizator | |
Fișier | palindrom.cpp | Dimensiune | 463 B |
Data încărcării | 05 Februarie 2020, 19:41 | Scor / rezultat | Eroare de compilare |
palindrom.cpp: In function 'int main()': palindrom.cpp:10:22: error: invalid conversion from 'int' to 'std::basic_istream<char>::char_type* {aka char*}' [-fpermissive] in.getline(s,256); ^ In file included from /usr/include/c++/4.8/sstream:38:0, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from palindrom.cpp:1: /usr/include/c++/4.8/istream:427:7: error: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::getline(std::basic_istream<_CharT, _Traits>::char_type*, std::streamsize) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>; std::basic_istream<_CharT, _Traits>::char_type = char; std::streamsize = int]' [-fpermissive] getline(char_type* __s, streamsize __n) ^ palindrom.cpp:13:19: error: invalid conversion from 'int' to 'const char*' [-fpermissive] k=strlen(s)-1; ^ In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from palindrom.cpp:1: /usr/include/string.h:399:15: error: initializing argument 1 of 'size_t strlen(const char*)' [-fpermissive] extern size_t strlen (const char *__s) ^ palindrom.cpp:14:25: error: invalid conversion from 'int' to 'const char*' [-fpermissive] while(j<strlen(s) && k>=0){ ^ In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from palindrom.cpp:1: /usr/include/string.h:399:15: error: initializing argument 1 of 'size_t strlen(const char*)' [-fpermissive] extern size_t strlen (const char *__s) ^ palindrom.cpp:14:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] while(j<strlen(s) && k>=0){ ^ palindrom.cpp:15:16: error: invalid types 'int[int]' for array subscript if(s[j]!=s[k]) ok=0; ^ palindrom.cpp:15:22: error: invalid types 'int[int]' for array subscript if(s[j]!=s[k]) ok=0; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Palindrom 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ă.