#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 | #60854945 | Utilizator | |
| Fișier | textcuv.cpp | Dimensiune | 1.11 KB |
| Data încărcării | 13 Noiembrie 2025, 09:51 | Scor/rezultat | Eroare de compilare |
textcuv.cpp:4:13: error: variable 'std::ifstream fin' has initializer but incomplete type ifstream fin("textcuv.in") ^ textcuv.cpp:5:5: error: expected ',' or ';' before 'ofstream' ofstream fout("textcuv.out") ^ textcuv.cpp: In function 'int main()': textcuv.cpp:11:1: error: expected ';' before 'fin' fin.getline(s, 1001); ^ textcuv.cpp:13:4: error: 'p' was not declared in this scope p=strtok(s,".,!?:;-"); ^ textcuv.cpp:13:13: error: 's' was not declared in this scope p=strtok(s,".,!?:;-"); ^ textcuv.cpp:15:12: error: 'v' was not declared in this scope {strcpy(v[n],p) ^ textcuv.cpp:16:8: error: expected ';' before 'n' n++; ^ textcuv.cpp:20:4: error: 'fout' was not declared in this scope {fout<<n<<'\n'; ^ textcuv.cpp:22:14: error: 'v' was not declared in this scope fout<<v[i]<<'\n'; ^ textcuv.cpp:24:19: error: 'mini' was not declared in this scope case 2: {strcpy(mini,v[0]); ^ textcuv.cpp:24:24: error: 'v' was not declared in this scope case 2: {strcpy(mini,v[0]); ^ textcuv.cpp:28:16: error: expected ';' before 'fout' fout<<mini;} ^ textcuv.cpp:31:25: error: 'v' was not declared in this scope if(strstr(v[i],"ini")!=NULL) ^ textcuv.cpp:33:15: error: 'fout' was not declared in this scope fout<<nr;} ^ textcuv.cpp:35:11: error: 'cuv' was not declared in this scope {strcpy(cuv,v[i]); ^ textcuv.cpp:35:15: error: 'v' was not declared in this scope {strcpy(cuv,v[i]); ^ textcuv.cpp:36:14: error: 'strrev' was not declared in this scope strrev(cuv); ^ textcuv.cpp:37:4: error: 'fout' was not declared in this scope fout<<cuv<<'\n';}} ^ textcuv.cpp:40:18: error: 'v' was not declared in this scope if(v[i][strlen(v[i])1]=='a') ^ textcuv.cpp:40:35: error: expected ']' before numeric constant if(v[i][strlen(v[i])1]=='a') ^ textcuv.cpp:40:35: error: expected ')' before numeric constant textcuv.cpp:40:36: error: expected primary-expression before ']' token if(v[i][strlen(v[i])1]=='a') ^ textcuv.cpp:40:36: error: expected ';' before ']' token textcuv.cpp:42:15: error: 'fout' was not declared in this scope fout<<nr;} ^ textcuv.cpp:45:22: error: 'v' was not declared in this scope {if(strlen(v[i])<lmin) ^ textcuv.cpp:46:19: error: invalid conversion from 'size_t (*)(const char*)throw () {aka unsigned int (*)(const char*)throw ()}' to 'int' [-fpermissive] lmin=strlen ^ textcuv.cpp:46:20: error: expected ';' at end of input lmin=strlen ^ textcuv.cpp:46:20: error: expected '}' at end of input textcuv.cpp:46:20: error: expected '}' at end of input textcuv.cpp:46:20: error: expected '}' at end of input textcuv.cpp:46:20: error: expected '}' at end of input
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ă.