#848
Paranteze1
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 | #58433135 | Utilizator | |
Fișier | paranteze1.cpp | Dimensiune | 600 B |
Data încărcării | 04 Iunie 2025, 08:39 | Scor / rezultat | Eroare de compilare |
paranteze1.cpp: In function 'int main()': paranteze1.cpp:18:27: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(st[k]=="(" && st[k-1]==")" || st[k-1]=="(" && st[k]==")"){ ^ paranteze1.cpp:18:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] paranteze1.cpp:18:43: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(st[k]=="(" && st[k-1]==")" || st[k-1]=="(" && st[k]==")"){ ^ paranteze1.cpp:18:43: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] paranteze1.cpp:18:59: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(st[k]=="(" && st[k-1]==")" || st[k-1]=="(" && st[k]==")"){ ^ paranteze1.cpp:18:59: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] paranteze1.cpp:18:73: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(st[k]=="(" && st[k-1]==")" || st[k-1]=="(" && st[k]==")"){ ^ paranteze1.cpp:18:73: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] paranteze1.cpp:18:31: warning: suggest parentheses around '&&' within '||' [-Wparentheses] if(st[k]=="(" && st[k-1]==")" || st[k-1]=="(" && st[k]==")"){ ^
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ă.