Detalii evaluare #62974193

Rezumat problemă

#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

Detalii

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 #62974193 Utilizator Catrinoiu Luca (Catrinoiu_Luca)
Fișier textcuv.cpp Dimensiune 1.14 KB
Data încărcării 09 Februarie 2026, 12:17 Scor/rezultat Eroare de compilare

Evaluare

Mesaj compilare

textcuv.cpp:4:14: warning: missing terminating " character [enabled by default]
 ifstream fin("textcuv.in);

              ^
textcuv.cpp:4:1: error: missing terminating " character
 ifstream fin("textcuv.in);

 ^
textcuv.cpp:5:15: warning: missing terminating " character [enabled by default]
 ofstream fout("textcuv.out);

               ^
textcuv.cpp:5:1: error: missing terminating " character
 ofstream fout("textcuv.out);

 ^
textcuv.cpp:6:14: error: expected identifier before '*' token
 char s[256], *p,cuv[1001][51],t[51];

              ^
textcuv.cpp:6:17: error: 'cuv' has not been declared
 char s[256], *p,cuv[1001][51],t[51];

                 ^
textcuv.cpp:6:31: error: 't' has not been declared
 char s[256], *p,cuv[1001][51],t[51];

                               ^
textcuv.cpp:6:36: error: expected ')' before ';' token
 char s[256], *p,cuv[1001][51],t[51];

                                    ^
textcuv.cpp:6:36: error: expected ')' before ';' token
textcuv.cpp: In function 'int main()':
textcuv.cpp:9: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:10: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:11: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:11:13: error: 's' was not declared in this scope
 fin.getline(s,256);

             ^
textcuv.cpp:12:1: error: 'p' was not declared in this scope
 p=strtok(s," .,;!?");

 ^
textcuv.cpp:16:12: error: 'cuv' was not declared in this scope
     strcpy(cuv[k],p);

            ^
textcuv.cpp:21:1: error: 'fout' was not declared in this scope
 fout<<k<<" ";

 ^
textcuv.cpp:24:7: error: 'cuv' was not declared in this scope
 fout<<cuv[i]<<" ";

       ^
textcuv.cpp:29:8: error: 't' was not declared in this scope
 strcpy(t,cuv[1]);

        ^
textcuv.cpp:29:10: error: 'cuv' was not declared in this scope
 strcpy(t,cuv[1]);

          ^
textcuv.cpp:33:1: error: 'fout' was not declared in this scope
 fout<<t;

 ^
textcuv.cpp:37:11: error: 'cuv' was not declared in this scope
 if(strstr(cuv[i],"ini")!=NULL)

           ^
textcuv.cpp:40:1: error: 'fout' was not declared in this scope
 fout<<nr;

 ^
textcuv.cpp:44:18: error: 'cuv' was not declared in this scope
         n=strlen(cuv[i]);

                  ^
textcuv.cpp:46:13: error: 'fout' was not declared in this scope
             fout<<cuv[i][j];

             ^
textcuv.cpp:47:9: error: 'fout' was not declared in this scope
         fout<<endl;

         ^
textcuv.cpp:52:10: error: 'cuv' was not declared in this scope
 z=strlen(cuv[i]);

          ^
textcuv.cpp:56:1: error: 'fout' was not declared in this scope
 fout<<x;

 ^
textcuv.cpp:59:13: error: 'cuv' was not declared in this scope
 lmin=strlen(cuv[1]);

             ^
textcuv.cpp:67:1: error: 'fout' was not declared in this scope
 fout<<lmin<<" "<<lmax;

 ^

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema textcuv face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.

Du-te sus!