#101
SortareCuvinte
Să se scrie un program care citește o propoziţie şi afişează cuvintele din propoziţie ordonate alfabetic.
Problema | SortareCuvinte | Operații I/O |
sortcuv.in /sortcuv.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #55030992 | Utilizator | |
Fișier | sortarecuvinte.cpp | Dimensiune | 702 B |
Data încărcării | 17 Decembrie 2024, 13:34 | Scor / rezultat | Eroare de compilare |
sortarecuvinte.cpp: In function 'int main()': sortarecuvinte.cpp:17:24: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(temp[n++] , c); ^ 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 sortarecuvinte.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)) ^ sortarecuvinte.cpp:23:29: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if(strcmp(temp[i],temp[j])>0){ ^ In file included from /usr/include/c++/4.8/cstring:42:0, from sortarecuvinte.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) ^ sortarecuvinte.cpp:23:37: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if(strcmp(temp[i],temp[j])>0){ ^ In file included from /usr/include/c++/4.8/cstring:42:0, from sortarecuvinte.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) ^ sortarecuvinte.cpp:25:26: error: 'v' was not declared in this scope strcpy(a,v[i]); ^ sortarecuvinte.cpp:26:30: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(temp[i],temp[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/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 sortarecuvinte.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)) ^ sortarecuvinte.cpp:26:38: error: invalid conversion from 'char' to 'const char*' [-fpermissive] strcpy(temp[i],temp[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/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 sortarecuvinte.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)) ^ sortarecuvinte.cpp:27:30: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(temp[j],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 sortarecuvinte.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 SortareCuvinte 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ă.