#3113
Se dă un șir de caractere care conține litere mici și mari ale alfabetului englez, spații și semne de punctuație. Să se afișeze fiecare cuvânt și frecvența de apariție a lui în șirul de caractere pe câte o linie fiecare pereche cuvânt-frecvență ordonate lexicografic.
Problema | CountWords | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 64 MB
|
Id soluție | #29143133 | Utilizator | |
Fișier | countwords.cpp | Dimensiune | 843 B |
Data încărcării | 02 Aprilie 2021, 12:30 | Scor / rezultat | 80 puncte |
countwords.cpp: In function 'int main()': countwords.cpp:20:26: warning: array subscript has type 'char' [-Wchar-subscripts] if(strcmp(v[i].sir, p)==0) ^ countwords.cpp:21:20: warning: array subscript has type 'char' [-Wchar-subscripts] v[i].k++, ok=1; ^ countwords.cpp:25:23: warning: array subscript has type 'char' [-Wchar-subscripts] strcpy(v[n].sir, p); ^ countwords.cpp:26:16: warning: array subscript has type 'char' [-Wchar-subscripts] v[n].k=1; ^ countwords.cpp:32:26: warning: array subscript has type 'char' [-Wchar-subscripts] if(strcmp(v[i].sir, v[j].sir)>0) ^ countwords.cpp:32:36: warning: array subscript has type 'char' [-Wchar-subscripts] if(strcmp(v[i].sir, v[j].sir)>0) ^ countwords.cpp:34:24: warning: array subscript has type 'char' [-Wchar-subscripts] aux=v[i]; ^ countwords.cpp:35:20: warning: array subscript has type 'char' [-Wchar-subscripts] v[i]=v[j]; ^ countwords.cpp:35:25: warning: array subscript has type 'char' [-Wchar-subscripts] v[i]=v[j]; ^ countwords.cpp:36:20: warning: array subscript has type 'char' [-Wchar-subscripts] v[j]=aux; ^ countwords.cpp:39:18: warning: array subscript has type 'char' [-Wchar-subscripts] cout<<v[i].sir<<' '<<v[i].k<<'\n'; ^ countwords.cpp:39:33: warning: array subscript has type 'char' [-Wchar-subscripts] cout<<v[i].sir<<' '<<v[i].k<<'\n'; ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0.004 secunde | OK. | 20 | 20 | Exemplu | |
2 | 0.004 secunde | OK. | 20 | 20 | ||
3 | 0.004 secunde | OK. | 20 | 20 | ||
4 | 0.004 secunde | Caught fatal signal 11 | 20 | 0 | ||
5 | 0.004 secunde | OK. | 20 | 20 | ||
Punctaj total | 80 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CountWords 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ă.