#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 | #40185009 | Utilizator | |
Fișier | palindrom.cpp | Dimensiune | 555 B |
Data încărcării | 29 Noiembrie 2022, 16:48 | Scor / rezultat | Eroare de compilare |
palindrom.cpp: In function 'bool palindrom(char, int, int)': palindrom.cpp:14:27: error: invalid types 'char[int]' for array subscript return (s[half_lenght]==s[full_lenght])&&palindrom(s,full_lenght, half_length-1); ^ palindrom.cpp:14:43: error: invalid types 'char[int]' for array subscript return (s[half_lenght]==s[full_lenght])&&palindrom(s,full_lenght, half_length-1); ^ palindrom.cpp:14:72: error: 'half_length' was not declared in this scope return (s[half_lenght]==s[full_lenght])&&palindrom(s,full_lenght, half_length-1); ^ palindrom.cpp: In function 'int main()': palindrom.cpp:22:29: error: invalid conversion from 'char' to 'const char*' [-fpermissive] int full_length=strlen(s)-1; ^ In file included from /usr/include/c++/4.8/cstring:42:0, from palindrom.cpp:2: /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:23:30: error: invalid conversion from 'char' to 'const char*' [-fpermissive] int half_lenght=(strlen(s)-1)/2 ; ^ In file included from /usr/include/c++/4.8/cstring:42:0, from palindrom.cpp:2: /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: In function 'bool palindrom(char, int, int)': palindrom.cpp:17:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
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ă.