Detalii evaluare #64683442

Rezumat problemă

Se dau n șiruri de paranteze rotunde. Să se stabilească, despre fiecare șir, dacă este corect parantezat.

Detalii

Problema Paranteze1 Operații I/O paranteze1.in/paranteze1.out
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #64683442 Utilizator Hutu Rares (rareshutu)
Fișier paranteze1.cpp Dimensiune 901 B
Data încărcării 22 Mai 2026, 15:42 Scor/rezultat Eroare de compilare

Evaluare

Mesaj compilare

paranteze1.cpp:22:2: error: stray ‘#’ in program
   22 | }#include <iostream>
      |  ^
paranteze1.cpp: In function ‘int main()’:
paranteze1.cpp:13:20: error: ‘strlen’ was not declared in this scope
   13 |         for(i=0; i<strlen(s); i++)
      |                    ^~~~~~
paranteze1.cpp:3:1: note: ‘strlen’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
    2 | #include<fstream>
  +++ |+#include <cstring>
    3 | using namespace std;
paranteze1.cpp: At global scope:
paranteze1.cpp:22:3: error: ‘include’ does not name a type
   22 | }#include <iostream>
      |   ^~~~~~~
In file included from paranteze1.cpp:23:
/usr/include/c++/13/cstring:77:11: error: ‘memchr’ has not been declared in ‘::’
   77 |   using ::memchr;
      |           ^~~~~~
/usr/include/c++/13/cstring:78:11: error: ‘memcmp’ has not been declared in ‘::’
   78 |   using ::memcmp;
      |           ^~~~~~
/usr/include/c++/13/cstring:79:11: error: ‘memcpy’ has not been declared in ‘::’
   79 |   using ::memcpy;
      |           ^~~~~~
/usr/include/c++/13/cstring:80:11: error: ‘memmove’ has not been declared in ‘::’
   80 |   using ::memmove;
      |           ^~~~~~~
/usr/include/c++/13/cstring:81:11: error: ‘memset’ has not been declared in ‘::’
   81 |   using ::memset;
      |           ^~~~~~
/usr/include/c++/13/cstring:82:11: error: ‘strcat’ has not been declared in ‘::’
   82 |   using ::strcat;
      |           ^~~~~~
/usr/include/c++/13/cstring:83:11: error: ‘strcmp’ has not been declared in ‘::’
   83 |   using ::strcmp;
      |           ^~~~~~
/usr/include/c++/13/cstring:84:11: error: ‘strcoll’ has not been declared in ‘::’
   84 |   using ::strcoll;
      |           ^~~~~~~
/usr/include/c++/13/cstring:85:11: error: ‘strcpy’ has not been declared in ‘::’
   85 |   using ::strcpy;
      |           ^~~~~~
/usr/include/c++/13/cstring:86:11: error: ‘strcspn’ has not been declared in ‘::’
   86 |   using ::strcspn;
      |           ^~~~~~~
/usr/include/c++/13/cstring:87:11: error: ‘strerror’ has not been declared in ‘::’
   87 |   using ::strerror;
      |           ^~~~~~~~
/usr/include/c++/13/cstring:88:11: error: ‘strlen’ has not been declared in ‘::’
   88 |   using ::strlen;
      |           ^~~~~~
/usr/include/c++/13/cstring:89:11: error: ‘strncat’ has not been declared in ‘::’
   89 |   using ::strncat;
      |           ^~~~~~~
/usr/include/c++/13/cstring:90:11: error: ‘strncmp’ has not been declared in ‘::’
   90 |   using ::strncmp;
      |           ^~~~~~~
/usr/include/c++/13/cstring:91:11: error: ‘strncpy’ has not been declared in ‘::’
   91 |   using ::strncpy;
      |           ^~~~~~~
/usr/include/c++/13/cstring:92:11: error: ‘strspn’ has not been declared in ‘::’
   92 |   using ::strspn;
      |           ^~~~~~
/usr/include/c++/13/cstring:93:11: error: ‘strtok’ has not been declared in ‘::’
   93 |   using ::strtok;
      |           ^~~~~~
/usr/include/c++/13/cstring:94:11: error: ‘strxfrm’ has not been declared in ‘::’
   94 |   using ::strxfrm;
      |           ^~~~~~~
/usr/include/c++/13/cstring:95:11: error: ‘strchr’ has not been declared in ‘::’
   95 |   using ::strchr;
      |           ^~~~~~
/usr/include/c++/13/cstring:96:11: error: ‘strpbrk’ has not been declared in ‘::’
   96 |   using ::strpbrk;
      |           ^~~~~~~
/usr/include/c++/13/cstring:97:11: error: ‘strrchr’ has not been declared in ‘::’
   97 |   using ::strrchr;
      |           ^~~~~~~
/usr/include/c++/13/cstring:98:11: error: ‘strstr’ has not been declared in ‘::’
   98 |   using ::strstr;
      |           ^~~~~~
paranteze1.cpp:26:10: error: redefinition of ‘std::ifstream fin’
   26 | ifstream fin("paranteze1.in");
      |          ^~~
paranteze1.cpp:4:10: note: ‘std::ifstream fin’ previously declared here
    4 | ifstream fin("paranteze1.in");
      |          ^~~
paranteze1.cpp:27:10: error: redefinition of ‘std::ofstream fout’
   27 | ofstream fout("paranteze1.out");
      |          ^~~~
paranteze1.cpp:5:10: note: ‘std::ofstream fout’ previously declared here
    5 | ofstream fout("paranteze1.out");
      |          ^~~~
paranteze1.cpp:28:5: error: redefinition of ‘int n’
   28 | int n, i, j, vf, nr1, nr2;
      |     ^
paranteze1.cpp:6:5: note: ‘int n’ previously declared here
    6 | int n, i, j, vf, nr1, nr2;
      |     ^
paranteze1.cpp:28:8: error: redefinition of ‘int i’
   28 | int n, i, j, vf, nr1, nr2;
      |        ^
paranteze1.cpp:6:8: note: ‘int i’ previously declared here
    6 | int n, i, j, vf, nr1, nr2;
      |        ^
paranteze1.cpp:28:11: error: redefinition of ‘int j’
   28 | int n, i, j, vf, nr1, nr2;
      |           ^
paranteze1.cpp:6:11: note: ‘int j’ previously declared here
    6 | int n, i, j, vf, nr1, nr2;
      |           ^
paranteze1.cpp:28:14: error: redefinition of ‘int vf’
   28 | int n, i, j, vf, nr1, nr2;
      |              ^~
paranteze1.cpp:6:14: note: ‘int vf’ previously declared here
    6 | int n, i, j, vf, nr1, nr2;
      |              ^~
paranteze1.cpp:28:18: error: redefinition of ‘int nr1’
   28 | int n, i, j, vf, nr1, nr2;
      |                  ^~~
paranteze1.cpp:6:18: note: ‘int nr1’ previously declared here
    6 | int n, i, j, vf, nr1, nr2;
      |                  ^~~
paranteze1.cpp:28:23: error: redefinition of ‘int nr2’
   28 | int n, i, j, vf, nr1, nr2;
      |                       ^~~
paranteze1.cpp:6:23: note: ‘int nr2’ previously declared here
    6 | int n, i, j, vf, nr1, nr2;
      |                       ^~~
paranteze1.cpp:29:6: error: redefinition of ‘char s [256]’
   29 | char s[256];
      |      ^
paranteze1.cpp:7:6: note: ‘char s [256]’ previously declared here
    7 | char s[256];
      |      ^
paranteze1.cpp:30:5: error: redefinition of ‘int main()’
   30 | int main()
      |     ^~~~
paranteze1.cpp:8:5: note: ‘int main()’ previously defined here
    8 | int main()
      |     ^~~~
paranteze1.cpp: In function ‘int main()’:
paranteze1.cpp:35:20: error: ‘strlen’ was not declared in this scope
   35 |         for(i=0; i<strlen(s); i++)
      |                    ^~~~~~
paranteze1.cpp:35:20: note: ‘strlen’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?

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 Paranteze1 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!