#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 | #62974232 | Utilizator | |
| Fișier | textcuv.cpp | Dimensiune | 1.16 KB |
| Data încărcării | 09 Februarie 2026, 12:18 | Scor/rezultat | Eroare de compilare |
textcuv.cpp:5:14: warning: missing terminating " character [enabled by default] ifstream fin("textcuv.in); ^ textcuv.cpp:5:1: error: missing terminating " character ifstream fin("textcuv.in); ^ textcuv.cpp:6:15: warning: missing terminating " character [enabled by default] ofstream fout("textcuv.out); ^ textcuv.cpp:6:1: error: missing terminating " character ofstream fout("textcuv.out); ^ textcuv.cpp:7:14: error: expected identifier before '*' token char s[256], *p,cuv[1001][51],t[51]; ^ textcuv.cpp:7:17: error: 'cuv' has not been declared char s[256], *p,cuv[1001][51],t[51]; ^ textcuv.cpp:7:31: error: 't' has not been declared char s[256], *p,cuv[1001][51],t[51]; ^ textcuv.cpp:7:36: error: expected ')' before ';' token char s[256], *p,cuv[1001][51],t[51]; ^ textcuv.cpp:7:36: error: expected ')' before ';' token textcuv.cpp: In function 'int main()': textcuv.cpp:10:10: error: invalid operands of types 'std::ifstream(std::ofstream (*)(char*, int*, int (*)[51], int*)) {aka std::basic_ifstream<char>(std::basic_ofstream<char> (*)(char*, int*, int (*)[51], int*))}' and 'int' to binary 'operator>>' fin>>T; ^ textcuv.cpp:11:9: error: request for member 'get' in 'fin', which is of non-class type 'std::ifstream(std::ofstream (*)(char*, int*, int (*)[51], int*)) {aka std::basic_ifstream<char>(std::basic_ofstream<char> (*)(char*, int*, int (*)[51], int*))}' fin.get(); ^ textcuv.cpp:12:5: error: request for member 'getline' in 'fin', which is of non-class type 'std::ifstream(std::ofstream (*)(char*, int*, int (*)[51], int*)) {aka std::basic_ifstream<char>(std::basic_ofstream<char> (*)(char*, int*, int (*)[51], int*))}' fin.getline(s,256); ^ textcuv.cpp:12:13: error: 's' was not declared in this scope fin.getline(s,256); ^ textcuv.cpp:13:1: error: 'p' was not declared in this scope p=strtok(s," .,;!?"); ^ textcuv.cpp:17:12: error: 'cuv' was not declared in this scope strcpy(cuv[k],p); ^ textcuv.cpp:22:1: error: 'fout' was not declared in this scope fout<<k<<" "; ^ textcuv.cpp:25:7: error: 'cuv' was not declared in this scope fout<<cuv[i]<<" "; ^ textcuv.cpp:30:8: error: 't' was not declared in this scope strcpy(t,cuv[1]); ^ textcuv.cpp:30:10: error: 'cuv' was not declared in this scope strcpy(t,cuv[1]); ^ textcuv.cpp:34:1: error: 'fout' was not declared in this scope fout<<t; ^ textcuv.cpp:38:11: error: 'cuv' was not declared in this scope if(strstr(cuv[i],"ini")!=NULL) ^ textcuv.cpp:41:1: error: 'fout' was not declared in this scope fout<<nr; ^ textcuv.cpp:45:18: error: 'cuv' was not declared in this scope n=strlen(cuv[i]); ^ textcuv.cpp:47:13: error: 'fout' was not declared in this scope fout<<cuv[i][j]; ^ textcuv.cpp:48:9: error: 'fout' was not declared in this scope fout<<endl; ^ textcuv.cpp:53:10: error: 'cuv' was not declared in this scope z=strlen(cuv[i]); ^ textcuv.cpp:57:1: error: 'fout' was not declared in this scope fout<<x; ^ textcuv.cpp:60:13: error: 'cuv' was not declared in this scope lmin=strlen(cuv[1]); ^ textcuv.cpp:68:1: error: 'fout' was not declared in this scope fout<<lmin<<" "<<lmax; ^
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ă.