#96
Să se scrie un program care citește o propoziție și determină cuvântul palindrom de lungime maximă.
| Problema | PalindromMaxim | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64585550 | Utilizator | |
| Fișier | palindrommaxim.cpp | Dimensiune | 1.24 KB |
| Data încărcării | 16 Mai 2026, 15:38 | Scor/rezultat | Eroare de compilare |
palindrommaxim.cpp: In function ‘int main()’: palindrommaxim.cpp:22:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 22 | for(int i=0;i<strlen(s);i++){ | ~^~~~~~~~~~ palindrommaxim.cpp:24:23: error: expected ‘)’ before ‘;’ token 24 | strcpy(s+i;s+i+1); | ~ ^ | ) palindrommaxim.cpp:24:29: error: expected ‘;’ before ‘)’ token 24 | strcpy(s+i;s+i+1); | ^ | ; palindrommaxim.cpp:24:27: warning: statement has no effect [-Wunused-value] 24 | strcpy(s+i;s+i+1); | ~~~^~ palindrommaxim.cpp:28:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 28 | for(int i=0;i<strlen(s);i++){ | ~^~~~~~~~~~ palindrommaxim.cpp:30:23: error: expected ‘)’ before ‘;’ token 30 | strcpy(s+i;s+i+1); | ~ ^ | ) palindrommaxim.cpp:30:29: error: expected ‘;’ before ‘)’ token 30 | strcpy(s+i;s+i+1); | ^ | ; palindrommaxim.cpp:30:27: warning: statement has no effect [-Wunused-value] 30 | strcpy(s+i;s+i+1); | ~~~^~ palindrommaxim.cpp:35:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 35 | for(int i=0;i<strlen(t);i++){ | ~^~~~~~~~~~ palindrommaxim.cpp:53:42: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 53 | if(palindrom(m[i++]) && strlen(p)>max){ | ~~~~~~~~~^~~~ palindrommaxim.cpp:20:24: warning: unused variable ‘c’ [-Wunused-variable] 20 | char s[256],t[256],c[21]="\0"; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PalindromMaxim 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ă.