#893
Cuvinte0
Se dă un șir de caractere format din cuvinte, separate prin spații. Cuvintele conțin doar litere mici ale alfabetului englez. Afișați, în ordine lexicografică, cuvintele distincte din șir.
Problema | Cuvinte0 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51205638 | Utilizator | |
Fișier | cuvinte0.cpp | Dimensiune | 725 B |
Data încărcării | 29 Mai 2024, 21:44 | Scor / rezultat | Eroare de compilare |
cuvinte0.cpp: In function 'int main()': cuvinte0.cpp:14:28: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if(strcmp(p,v[i])==0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from cuvinte0.cpp:2: /usr/include/string.h:144:12: error: initializing argument 2 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ cuvinte0.cpp:18:23: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(v[n],p); ^ 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 cuvinte0.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)) ^ cuvinte0.cpp:25:26: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if(strcmp(v[i],v[j])>0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from cuvinte0.cpp:2: /usr/include/string.h:144:12: error: initializing argument 1 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ cuvinte0.cpp:25:31: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if(strcmp(v[i],v[j])>0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from cuvinte0.cpp:2: /usr/include/string.h:144:12: error: initializing argument 2 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ cuvinte0.cpp:27:29: error: invalid conversion from 'char' to 'const char*' [-fpermissive] strcpy(s,v[i]); ^ 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 cuvinte0.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)) ^ cuvinte0.cpp:28:27: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(v[i],v[j]); ^ 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 cuvinte0.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)) ^ cuvinte0.cpp:28:32: error: invalid conversion from 'char' to 'const char*' [-fpermissive] strcpy(v[i],v[j]); ^ 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 cuvinte0.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)) ^ cuvinte0.cpp:29:27: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(v[j],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/iostream:38, from cuvinte0.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)) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Cuvinte0 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ă.