#96
PalindromMaxim
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 | #54160022 | Utilizator | |
Fișier | palindrommaxim.cpp | Dimensiune | 663 B |
Data încărcării | 21 Noiembrie 2024, 08:19 | Scor / rezultat | Eroare de compilare |
palindrommaxim.cpp: In function 'int main()': palindrommaxim.cpp:32:21: error: invalid conversion from 'char*' to 'char' [-fpermissive] char p=strtok(s,sep); ^ palindrommaxim.cpp:33:11: warning: NULL used in arithmetic [-Wpointer-arith] while(p!=NULL) ^ palindrommaxim.cpp:35:17: error: invalid conversion from 'char' to 'char*' [-fpermissive] if(palindrom(p)!=true) ^ palindrommaxim.cpp:8:6: error: initializing argument 1 of 'bool palindrom(char*)' [-fpermissive] bool palindrom(char s[]) ^ palindrommaxim.cpp:37:17: error: invalid conversion from 'char' to 'const char*' [-fpermissive] lung=strlen(p); ^ In file included from /usr/include/c++/4.8/cstring:42:0, from palindrommaxim.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) ^ palindrommaxim.cpp:40:17: error: invalid conversion from 'int' to 'char*' [-fpermissive] strcpy(pal,s); ^ In file included from /usr/include/features.h:374:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426, from /usr/include/c++/4.8/cstring:41, from palindrommaxim.cpp:1: /usr/include/i386-linux-gnu/bits/string3.h:102:1: error: initializing argument 1 of 'char* strcpy(char*, const char*)' [-fpermissive] __NTH (strcpy (char *__restrict __dest, const char *__restrict __src)) ^ palindrommaxim.cpp:43:17: error: invalid conversion from 'int' to 'char*' [-fpermissive] p=strtok(pal,p); ^ In file included from /usr/include/c++/4.8/cstring:42:0, from palindrommaxim.cpp:1: /usr/include/string.h:348:14: error: initializing argument 1 of 'char* strtok(char*, const char*)' [-fpermissive] extern char *strtok (char *__restrict __s, const char *__restrict __delim) ^ palindrommaxim.cpp:43:17: error: invalid conversion from 'char' to 'const char*' [-fpermissive] p=strtok(pal,p); ^ In file included from /usr/include/c++/4.8/cstring:42:0, from palindrommaxim.cpp:1: /usr/include/string.h:348:14: error: initializing argument 2 of 'char* strtok(char*, const char*)' [-fpermissive] extern char *strtok (char *__restrict __s, const char *__restrict __delim) ^ palindrommaxim.cpp:43:17: error: invalid conversion from 'char*' to 'char' [-fpermissive] p=strtok(pal,p); ^
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ă.