#4756
Se citește un text format din cuvinte și separatori. Cuvintele sunt formate din litere mici ale alfabetului, iar separatorii sunt spațiul, plus caracterele din șirul '.,!?:;-.
1) Să se afișeze n – numărul de cuvinte, precum și cuvintele din text.
2) Se se afișeze cuvântul cel mai mic din punct de vedere lexicografic.
3) Să se determine numărul de cuvinte care conțin secvența ini.
4) Să se afișeze fiecare cuvânt oglindit.
5) Să se determine câte cuvinte se termină cu litera a.
6) Să se determine lungimea minimă și lungimea maximă a unui cuvânt
| Problema | textcuv | Operații I/O |
textcuv.in/textcuv.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 16 MB
/
Stivă 8 MB
|
| Id soluție | #64346318 | Utilizator | |
| Fișier | textcuv.cpp | Dimensiune | 1.66 KB |
| Data încărcării | 30 Aprilie 2026, 19:12 | Scor/rezultat | 20 puncte |
textcuv.cpp: In function ‘int main()’: textcuv.cpp:33:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 33 | { if(strcmp(p, mic)<0) | ^~ textcuv.cpp:35:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 35 | p=strtok(NULL, ".,!?:;- "); | ^ textcuv.cpp:56:7: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 56 | { for(int i=strlen(p)-1, j=0;i>=0;i--, j++) | ^~~ textcuv.cpp:58:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 58 | ogl[j]='\0'; | ^~~ textcuv.cpp:86:14: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 86 | if(strlen(p)>maxi) | ~~~~~~~~~^~~~~ textcuv.cpp:88:14: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare] 88 | if(strlen(p)<mini) | ~~~~~~~~~^~~~~ textcuv.cpp:58:12: warning: ‘j’ may be used uninitialized [-Wmaybe-uninitialized] 58 | ogl[j]='\0'; | ~~~~~~^~~~~ textcuv.cpp:53:26: note: ‘j’ was declared here 53 | fin.getline(S,1001);int j; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | OK. | 10 | 10 | ||
| 2 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 6 | Depășit | Limita de timp depășită | 10 | 0 | ||
| 7 | 0.001 secunde | OK. | 10 | 10 | ||
| 8 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 9 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 10 | 0.001 secunde | Raspuns gresit. | 5 | 0 | ||
| 11 | 0.002 secunde | Raspuns gresit. | 5 | 0 | ||
| 12 | Depășit | Limita de timp depășită | 5 | 0 | ||
| Punctaj total | 20 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema textcuv 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ă.