| Problema | oop_3 | Operații I/O |
oop_3.in/oop_3.out
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64255115 | Utilizator | |
| Fișier | oop_3.cpp | Dimensiune | 452 B |
| Data încărcării | 26 Aprilie 2026, 14:45 | Scor/rezultat | Eroare de compilare |
oop_3.cpp: In function ‘void Push(int)’: oop_3.cpp:6:9: error: ‘v’ was not declared in this scope 6 | v[++n]=x; | ^ oop_3.cpp:6:13: error: ‘n’ was not declared in this scope 6 | v[++n]=x; | ^ oop_3.cpp: In function ‘void Pop()’: oop_3.cpp:10:13: error: ‘n’ was not declared in this scope; did you mean ‘yn’? 10 | if (n>0) n--; | ^ | yn oop_3.cpp: In function ‘int Top()’: oop_3.cpp:14:13: error: ‘Empty’ was not declared in this scope 14 | if (Empty()) return -1; | ^~~~~ oop_3.cpp:15:21: error: ‘v’ was not declared in this scope 15 | else return v[n]; | ^ oop_3.cpp:15:23: error: ‘n’ was not declared in this scope; did you mean ‘yn’? 15 | else return v[n]; | ^ | yn oop_3.cpp: In function ‘int Max()’: oop_3.cpp:19:13: error: ‘Empty’ was not declared in this scope 19 | if (Empty()) return -1; | ^~~~~ oop_3.cpp:21:23: error: ‘v’ was not declared in this scope 21 | int maxim=v[1]; | ^ oop_3.cpp:22:30: error: ‘n’ was not declared in this scope 22 | for (int i=2; i<=n; i++) maxim=max(maxim, v[i]); | ^ oop_3.cpp: In function ‘int Empty()’: oop_3.cpp:28:16: error: ‘n’ was not declared in this scope; did you mean ‘yn’? 28 | return n==0; | ^ | yn oop_3.cpp: In function ‘int main()’: oop_3.cpp:36:5: error: ‘Stiva’ was not declared in this scope 36 | Stiva w; | ^~~~~ oop_3.cpp:44:13: error: ‘w’ was not declared in this scope 44 | w.Push(x); | ^ oop_3.cpp:47:13: error: ‘w’ was not declared in this scope 47 | w.Pop(); | ^ oop_3.cpp:49:21: error: ‘w’ was not declared in this scope 49 | fout << w.Top() << "\n"; | ^ oop_3.cpp:51:21: error: ‘w’ was not declared in this scope 51 | fout << w.Max() << "\n"; | ^ oop_3.cpp: In function ‘int Max()’: oop_3.cpp:25:5: warning: control reaches end of non-void function [-Wreturn-type] 25 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema oop_3 face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.