#2640
ExtrageCuvant
C++
Găsiţi cuvântul de pe o anumită poziţie dintr-un şir de caractere.
Problema | ExtrageCuvant | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #35664908 | Utilizator | |
Fișier | extragecuvant.cpp | Dimensiune | 304 B |
Data încărcării | 17 Martie 2022, 18:21 | Scor / rezultat | Eroare de compilare |
extragecuvant.cpp: In function 'bool extrageCuvant(char, char, char, int)': extragecuvant.cpp:19:23: error: invalid conversion from 'char' to 'char*' [-fpermissive] p=strtok(sursa,sep); ^ In file included from extragecuvant.cpp:12:0: /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) ^ extragecuvant.cpp:19:23: error: invalid conversion from 'char' to 'const char*' [-fpermissive] p=strtok(sursa,sep); ^ In file included from extragecuvant.cpp:12:0: /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) ^ extragecuvant.cpp:22:32: error: invalid conversion from 'char' to 'char*' [-fpermissive] if(i==n) {strcpy(dest,p);return 1;} ^ 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/iostream:38, from extragecuvant.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)) ^ extragecuvant.cpp:23:29: error: invalid conversion from 'char' to 'char*' [-fpermissive] i++;strtok(sursa,sep); ^ In file included from extragecuvant.cpp:12:0: /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) ^ extragecuvant.cpp:23:29: error: invalid conversion from 'char' to 'const char*' [-fpermissive] i++;strtok(sursa,sep); ^ In file included from extragecuvant.cpp:12:0: /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) ^ extragecuvant.cpp: In function 'int main()': extragecuvant.cpp:47:45: error: invalid conversion from 'char*' to 'char' [-fpermissive] while(extrageCuvant(a,text,separatori,i)) ^ extragecuvant.cpp:15:6: error: initializing argument 1 of 'bool extrageCuvant(char, char, char, int)' [-fpermissive] bool extrageCuvant(char dest, char sursa, char sep, int n) ^ extragecuvant.cpp:47:45: error: invalid conversion from 'char*' to 'char' [-fpermissive] while(extrageCuvant(a,text,separatori,i)) ^ extragecuvant.cpp:15:6: error: initializing argument 2 of 'bool extrageCuvant(char, char, char, int)' [-fpermissive] bool extrageCuvant(char dest, char sursa, char sep, int n) ^ extragecuvant.cpp:47:45: error: invalid conversion from 'char*' to 'char' [-fpermissive] while(extrageCuvant(a,text,separatori,i)) ^ extragecuvant.cpp:15:6: error: initializing argument 3 of 'bool extrageCuvant(char, char, char, int)' [-fpermissive] bool extrageCuvant(char dest, char sursa, char sep, int n) ^ extragecuvant.cpp:49:52: error: invalid conversion from 'char*' to 'char' [-fpermissive] int ok = extrageCuvant(a,text,separatori,i); ^ extragecuvant.cpp:15:6: error: initializing argument 1 of 'bool extrageCuvant(char, char, char, int)' [-fpermissive] bool extrageCuvant(char dest, char sursa, char sep, int n) ^ extragecuvant.cpp:49:52: error: invalid conversion from 'char*' to 'char' [-fpermissive] int ok = extrageCuvant(a,text,separatori,i); ^ extragecuvant.cpp:15:6: error: initializing argument 2 of 'bool extrageCuvant(char, char, char, int)' [-fpermissive] bool extrageCuvant(char dest, char sursa, char sep, int n) ^ extragecuvant.cpp:49:52: error: invalid conversion from 'char*' to 'char' [-fpermissive] int ok = extrageCuvant(a,text,separatori,i); ^ extragecuvant.cpp:15:6: error: initializing argument 3 of 'bool extrageCuvant(char, char, char, int)' [-fpermissive] bool extrageCuvant(char dest, char sursa, char sep, int n) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ExtrageCuvant face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.