#848
Se dau n
șiruri de paranteze rotunde. Să se stabilească, despre fiecare șir, dacă este corect parantezat.
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 | #58357721 | Utilizator | |
Fișier | paranteze1.cpp | Dimensiune | 938 B |
Data încărcării | 29 Mai 2025, 09:22 | Scor / rezultat | Eroare de compilare |
paranteze1.cpp:3:1: error: 'ifstream' does not name a type ifstream fin("paranteze.in") ^ paranteze1.cpp:9:12: error: variable or field 'pop' declared void void pop ( Node *&varf) ^ paranteze1.cpp:9:12: error: 'Node' was not declared in this scope paranteze1.cpp:9:19: error: 'varf' was not declared in this scope void pop ( Node *&varf) ^ paranteze1.cpp:16:9: error: 'node' was not declared in this scope int top(node*varf) ^ paranteze1.cpp:16:14: error: 'varf' was not declared in this scope int top(node*varf) ^ paranteze1.cpp:17:1: error: expected ',' or ';' before '{' token { ^ paranteze1.cpp:19:16: error: 'Node' was not declared in this scope bool empty(Node*&varf) ^ paranteze1.cpp:19:22: error: 'varf' was not declared in this scope bool empty(Node*&varf) ^ paranteze1.cpp:20:5: error: expected ',' or ';' before '{' token { ^ paranteze1.cpp:24:11: error: variable or field 'push' declared void void push(Node *&varf, int x) ^ paranteze1.cpp:24:11: error: 'Node' was not declared in this scope paranteze1.cpp:24:18: error: 'varf' was not declared in this scope void push(Node *&varf, int x) ^ paranteze1.cpp:24:24: error: expected primary-expression before 'int' void push(Node *&varf, int x) ^ paranteze1.cpp:31:1: error: 'Node' does not name a type Node*varf; ^ paranteze1.cpp: In function 'int verific(char*)': paranteze1.cpp:34:5: error: 'varf' was not declared in this scope varf=NULL; ^ paranteze1.cpp:36:23: error: 'strlen' was not declared in this scope for(i=0;i<strlen(s);i++) ^ paranteze1.cpp:38:20: error: 'push' was not declared in this scope push (varf ,'('); ^ paranteze1.cpp:40:18: error: 'empty' cannot be used as a function if(empty(varf)) return 0; ^ paranteze1.cpp:42:13: error: 'pop' was not declared in this scope pop(varf); ^ paranteze1.cpp:43:19: error: 'empty' cannot be used as a function if(!empty(varf)) return 0; ^ paranteze1.cpp: In function 'int main()': paranteze1.cpp:52:5: error: 'fin' was not declared in this scope fin>>n; ^ paranteze1.cpp:56:5: error: 'fout' was not declared in this scope fout<<verific(s)<<endl; ^ paranteze1.cpp:56:23: error: 'endl' was not declared in this scope fout<<verific(s)<<endl; ^ paranteze1.cpp:56:23: note: suggested alternative: In file included from /usr/include/c++/4.8/iostream:39:0, from paranteze1.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ paranteze1.cpp: At global scope: paranteze1.cpp:62:5: error: expected unqualified-id before 'return' return 0; ^ paranteze1.cpp:63:1: error: expected declaration before '}' token } ^ paranteze1.cpp: In function 'int verific(char*)': paranteze1.cpp:46:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Paranteze1 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ă.