#852
Paranteze3
Se dau n
șiruri de paranteze rotunde sau pătrate. Să se stabilească, despre fiecare șir, dacă este corect parantezat.
Problema | Paranteze3 | Operații I/O |
paranteze3.in /paranteze3.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53861932 | Utilizator | |
Fișier | paranteze3.cpp | Dimensiune | 2.56 KB |
Data încărcării | 13 Noiembrie 2024, 13:46 | Scor / rezultat | Eroare de compilare |
paranteze3.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ paranteze3.cpp:1:7: error: 'System' has not been declared paranteze3.cpp:2:7: error: expected nested-name-specifier before 'System' using System.Collections.Generic; ^ paranteze3.cpp:2:7: error: 'System' has not been declared paranteze3.cpp:2:13: error: expected ';' before '.' token using System.Collections.Generic; ^ paranteze3.cpp:2:13: error: expected unqualified-id before '.' token paranteze3.cpp:3:7: error: expected nested-name-specifier before 'System' using System.IO; ^ paranteze3.cpp:3:7: error: 'System' has not been declared paranteze3.cpp:3:13: error: expected ';' before '.' token using System.IO; ^ paranteze3.cpp:3:13: error: expected unqualified-id before '.' token paranteze3.cpp:4:7: error: expected nested-name-specifier before 'System' using System.Linq; ^ paranteze3.cpp:4:7: error: 'System' has not been declared paranteze3.cpp:4:13: error: expected ';' before '.' token using System.Linq; ^ paranteze3.cpp:4:13: error: expected unqualified-id before '.' token paranteze3.cpp:5:7: error: expected nested-name-specifier before 'System' using System.Text; ^ paranteze3.cpp:5:7: error: 'System' has not been declared paranteze3.cpp:5:13: error: expected ';' before '.' token using System.Text; ^ paranteze3.cpp:5:13: error: expected unqualified-id before '.' token paranteze3.cpp:6:7: error: expected nested-name-specifier before 'System' using System.Threading.Tasks; ^ paranteze3.cpp:6:7: error: 'System' has not been declared paranteze3.cpp:6:13: error: expected ';' before '.' token using System.Threading.Tasks; ^ paranteze3.cpp:6:13: error: expected unqualified-id before '.' token paranteze3.cpp:10:11: error: 'Nod' is not a class template class Nod<T> ^ paranteze3.cpp:10:15: error: 'T' was not declared in this scope class Nod<T> ^ paranteze3.cpp:12:16: error: expected ':' before 'T' public T info; ^ paranteze3.cpp:12:16: error: 'T' does not name a type paranteze3.cpp:13:16: error: expected ':' before 'Nod' public Nod<T> leg; ^ paranteze3.cpp:13:16: error: 'p26_ClaseTemplate::Nod' is not a template paranteze3.cpp:13:20: error: 'T' was not declared in this scope public Nod<T> leg; ^ paranteze3.cpp:13:23: error: field 'leg' has incomplete type public Nod<T> leg; ^ paranteze3.cpp:14:16: error: expected ':' before 'Nod' public Nod(T x) ^ paranteze3.cpp:14:22: error: expected ')' before 'x' public Nod(T x) ^ paranteze3.cpp:19:5: error: expected ';' after class definition } ^ paranteze3.cpp:21:11: error: 'Stiva' is not a class template class Stiva<T> ^ paranteze3.cpp:21:17: error: 'T' was not declared in this scope class Stiva<T> ^ paranteze3.cpp:23:17: error: expected ':' before 'Nod' private Nod<T> top; ^ paranteze3.cpp:23:17: error: 'p26_ClaseTemplate::Nod' is not a template paranteze3.cpp:23:21: error: 'T' was not declared in this scope private Nod<T> top; ^ paranteze3.cpp:24:17: error: expected ':' before 'int' private int n; // numarul de elemente ^ paranteze3.cpp:26:16: error: expected ':' before 'Stiva' public Stiva() ^ paranteze3.cpp:32:16: error: expected ':' before 'void' public void Push(T x) ^ paranteze3.cpp:32:26: error: 'T' has not been declared public void Push(T x) ^ paranteze3.cpp:40:16: error: expected ':' before 'void' public void Pop() ^ paranteze3.cpp:47:16: error: expected ':' before 'T' public T Top() ^ paranteze3.cpp:47:16: error: 'T' does not name a type paranteze3.cpp:52:16: error: expected ':' before 'bool' public bool Empty() ^ paranteze3.cpp:57:16: error: expected ':' before 'void' public void Init() ^ paranteze3.cpp:62:16: error: expected ':' before 'int' public int Count ^ paranteze3.cpp:65:9: error: expected ';' at end of member declaration } ^ paranteze3.cpp:66:5: error: expected ';' after class definition } ^ paranteze3.cpp:64:13: error: 'get' was not declared in this scope get { return n; } ^ paranteze3.cpp:64:17: error: expected '}' before '{' token get { return n; } ^ paranteze3.cpp:64:17: error: cannot convert '<brace-enclosed initializer list>' to 'int' in initialization paranteze3.cpp:64:17: error: expected ';' before '{' token paranteze3.cpp: In member function 'void p26_ClaseTemplate::Stiva::Push(int)': paranteze3.cpp:34:13: error: 'p26_ClaseTemplate::Nod' is not a template Nod<T> p = new Nod<T>(x); ^ paranteze3.cpp:34:17: error: 'T' was not declared in this scope Nod<T> p = new Nod<T>(x); ^ paranteze3.cpp:34:28: error: 'p26_ClaseTemplate::Nod' is not a template Nod<T> p = new Nod<T>(x); ^ paranteze3.cpp:34:32: error: the value of 'T' is not usable in a constant expression Nod<T> p = new Nod<T>(x); ^ paranteze3.cpp:34:17: note: 'T' was not declared 'constexpr' Nod<T> p = new Nod<T>(x); ^ paranteze3.cpp:34:36: error: no matching function for call to 'p26_ClaseTemplate::Nod::Nod(int&)' Nod<T> p = new Nod<T>(x); ^ paranteze3.cpp:34:36: note: candidates are: paranteze3.cpp:10:11: note: constexpr p26_ClaseTemplate::Nod::Nod() class Nod<T> ^ paranteze3.cpp:10:11: note: candidate expects 0 arguments, 1 provided paranteze3.cpp:10:11: note: constexpr p26_ClaseTemplate::Nod::Nod(const p26_ClaseTemplate::Nod&) paranteze3.cpp:10:11: note: no known conversion for argument 1 from 'int' to 'const p26_ClaseTemplate::Nod&' paranteze3.cpp:10:11: note: constexpr p26_ClaseTemplate::Nod::Nod(p26_ClaseTemplate::Nod&&) paranteze3.cpp:10:11: note: no known conversion for argument 1 from 'int' to 'p26_ClaseTemplate::Nod&&' paranteze3.cpp:35:15: error: 'class p26_ClaseTemplate::Nod' has no member named 'leg' p.leg = top; ^ paranteze3.cpp: In member function 'void p26_ClaseTemplate::Stiva::Pop()': paranteze3.cpp:42:24: error: 'null' was not declared in this scope if (top == null) return; ^ paranteze3.cpp:43:23: error: 'class p26_ClaseTemplate::Nod' has no member named 'leg' top = top.leg; ^ paranteze3.cpp: In member function 'bool p26_ClaseTemplate::Stiva::Empty()': paranteze3.cpp:54:27: error: 'null' was not declared in this scope return top == null; ^ paranteze3.cpp: In member function 'void p26_ClaseTemplate::Stiva::Init()': paranteze3.cpp:59:19: error: 'null' was not declared in this scope top = null; ^ paranteze3.cpp: At global scope: paranteze3.cpp:70:26: error: 'string' has not been declared static void Main(string[] args) ^ paranteze3.cpp:70:35: error: expected ',' or '...' before 'args' static void Main(string[] args) ^ paranteze3.cpp:106:5: error: expected ';' after class definition } ^ paranteze3.cpp: In static member function 'static void p26_ClaseTemplate::Program::Main(int*)': paranteze3.cpp:73:13: error: 'string' was not declared in this scope string a; ^ paranteze3.cpp:73:20: error: expected ';' before 'a' string a; ^ paranteze3.cpp:74:13: error: 'StreamReader' was not declared in this scope StreamReader fin = new StreamReader("paranteze3.in"); ^ paranteze3.cpp:74:26: error: expected ';' before 'fin' StreamReader fin = new StreamReader("paranteze3.in"); ^ paranteze3.cpp:75:13: error: 'StreamWriter' was not declared in this scope StreamWriter fout = new StreamWriter("paranteze3.out"); ^ paranteze3.cpp:75:26: error: expected ';' before 'fout' StreamWriter fout = new StreamWriter("paranteze3.out"); ^ paranteze3.cpp:76:17: error: expected primary-expression before 'int' n = int.Parse(fin.ReadLine()); ^ paranteze3.cpp:76:17: error: expected ';' before 'int' paranteze3.cpp:79:17: error: 'a' was not declared in this scope a = fin.ReadLine(); ^ paranteze3.cpp:79:21: error: 'fin' was not declared in this scope a = fin.ReadLine(); ^ paranteze3.cpp:80:17: error: 'p26_ClaseTemplate::Stiva' is not a template Stiva<char> st = new Stiva<char>(); ^ paranteze3.cpp:80:38: error: 'p26_ClaseTemplate::Stiva' is not a template Stiva<char> st = new Stiva<char>(); ^ paranteze3.cpp:80:50: error: conversion from 'p26_ClaseTemplate::Stiva*' to non-scalar type 'p26_ClaseTemplate::Stiva' requested Stiva<char> st = new Stiva<char>(); ^ paranteze3.cpp:89:37: error: 'class p26_ClaseTemplate::Stiva' has no member named 'Top' else if (st.Top() != '(') verif = false; ^ paranteze3.cpp:95:37: error: 'class p26_ClaseTemplate::Stiva' has no member named 'Top' else if (st.Top() != '[') verif = false; ^ paranteze3.cpp:100:28: error: 'fout' was not declared in this scope if (verif) fout.WriteLine("1"); ^ paranteze3.cpp:101:22: error: 'fout' was not declared in this scope else fout.WriteLine("0"); ^ paranteze3.cpp:103:13: error: 'fin' was not declared in this scope fin.Close(); ^ paranteze3.cpp:104:13: error: 'fout' was not declared in this scope fout.Close(); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Paranteze3 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ă.