#188
InlocuireCuvant
Se dau două cuvinte şi o propoziţie. Să se înlocuiască în propoziţie fiecare apariţie a primului cuvânt cu al doilea.
Problema | InlocuireCuvant | Operații I/O |
inlocuirecuvant.in /inlocuirecuvant.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #55149160 | Utilizator | |
Fișier | inlocuirecuvant.cpp | Dimensiune | 449 B |
Data încărcării | 30 Decembrie 2024, 19:55 | Scor / rezultat | Eroare de compilare |
inlocuirecuvant.cpp: In function 'int main()': inlocuirecuvant.cpp:13:21: error: invalid conversion from 'char*' to 'char' [-fpermissive] char p=strstr(s,a); ^ inlocuirecuvant.cpp:15:18: error: invalid conversion from 'size_t {aka unsigned int}' to 'const char*' [-fpermissive] strcpy(x,p+strlen(a)); ^ 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/iosfwd:38, from /usr/include/c++/4.8/ios:38, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from inlocuirecuvant.cpp:1: /usr/include/i386-linux-gnu/bits/string3.h:102:1: error: initializing argument 2 of 'char* strcpy(char*, const char*)' [-fpermissive] __NTH (strcpy (char *__restrict __dest, const char *__restrict __src)) ^ inlocuirecuvant.cpp:16:18: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(p,b); ^ 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/iosfwd:38, from /usr/include/c++/4.8/ios:38, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from inlocuirecuvant.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)) ^ inlocuirecuvant.cpp:17:18: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcat(p,x); ^ 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/iosfwd:38, from /usr/include/c++/4.8/ios:38, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/fstream:38, from inlocuirecuvant.cpp:1: /usr/include/i386-linux-gnu/bits/string3.h:140:1: error: initializing argument 1 of 'char* strcat(char*, const char*)' [-fpermissive] __NTH (strcat (char *__restrict __dest, const char *__restrict __src)) ^ inlocuirecuvant.cpp:18:20: error: call of overloaded 'strstr(char&, char [11])' is ambiguous p=strstr(p,a); ^ inlocuirecuvant.cpp:18:20: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from inlocuirecuvant.cpp:3: /usr/include/string.h:329:1: note: char* strstr(char*, const char*) <near match> strstr (char *__haystack, const char *__needle) __THROW ^ /usr/include/string.h:329:1: note: no known conversion for argument 1 from 'char' to 'char*' /usr/include/string.h:335:1: note: const char* strstr(const char*, const char*) <near match> strstr (const char *__haystack, const char *__needle) __THROW ^ /usr/include/string.h:335:1: note: no known conversion for argument 1 from 'char' to 'const char*'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema InlocuireCuvant 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ă.