#990
SortareCuvinte1
Să se scrie un program care citește o listă de cuvinte şi le afişează în ordine alfabetică.
Problema | SortareCuvinte1 | Operații I/O |
sortarecuvinte1.in /sortarecuvinte1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #48029091 | Utilizator | |
Fișier | sortarecuvinte1.cpp | Dimensiune | 550 B |
Data încărcării | 13 Ianuarie 2024, 14:30 | Scor / rezultat | Eroare de compilare |
sortarecuvinte1.cpp:4:13: error: variable 'std::ifstream fin' has initializer but incomplete type ifstream fin("sortarecuvinte1.in"); ^ sortarecuvinte1.cpp:5:14: error: variable 'std::ofstream fout' has initializer but incomplete type ofstream fout("sortarecuvinte1.out"); ^ sortarecuvinte1.cpp: In function 'int main()': sortarecuvinte1.cpp:10:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0;i<strlen(s);i++) ^ sortarecuvinte1.cpp:11:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int j=i+1;j<strlen(s);j++) ^ sortarecuvinte1.cpp:12:26: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if(strcmp(s[i],s[j])>0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from sortarecuvinte1.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) ^ sortarecuvinte1.cpp:12:31: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if(strcmp(s[i],s[j])>0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from sortarecuvinte1.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) ^ sortarecuvinte1.cpp:15:29: error: invalid conversion from 'char' to 'const char*' [-fpermissive] strcpy(a,s[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 sortarecuvinte1.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)) ^ sortarecuvinte1.cpp:16:27: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(s[i],s[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 sortarecuvinte1.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)) ^ sortarecuvinte1.cpp:16:32: error: invalid conversion from 'char' to 'const char*' [-fpermissive] strcpy(s[i],s[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 sortarecuvinte1.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)) ^ sortarecuvinte1.cpp:17:27: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(s[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/iostream:38, from sortarecuvinte1.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)) ^ sortarecuvinte1.cpp:20:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0;i<strlen(s);i++) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SortareCuvinte1 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ă.