#3606
Definim un limbaj de programare, cu instrucțiuni de atribuire și de decizie. Cunoscând valorile inițiale ale tuturor variabilelor(de la a la z), să se determine valorile tuturor variabilelor după execuția unei secvențe de program.
ONI 2006, Clasa a IX-a
| Problema | limbaj | Operații I/O |
limbaj.in/limbaj.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 16 MB
/
Stivă 4 MB
|
| Id soluție | #64688440 | Utilizator | |
| Fișier | limbaj.cpp | Dimensiune | 2.51 KB |
| Data încărcării | 23 Mai 2026, 10:53 | Scor/rezultat | Eroare de compilare |
limbaj.cpp:12:1: error: ‘stack’ does not name a type; did you mean ‘obstack’? 12 | stack <string> s; | ^~~~~ | obstack limbaj.cpp: In function ‘void verif()’: limbaj.cpp:18:20: warning: array subscript has type ‘char’ [-Wchar-subscripts] 18 | if ( v[a[1]] == v[a[2]] ) { | ^ limbaj.cpp:18:31: warning: array subscript has type ‘char’ [-Wchar-subscripts] 18 | if ( v[a[1]] == v[a[2]] ) { | ^ limbaj.cpp:19:13: error: ‘s’ was not declared in this scope 19 | s.push("da"); | ^ limbaj.cpp:22:13: error: ‘s’ was not declared in this scope 22 | s.push("nu"); | ^ limbaj.cpp:26:20: warning: array subscript has type ‘char’ [-Wchar-subscripts] 26 | if ( v[a[1]] > v[a[2]] ) { | ^ limbaj.cpp:26:30: warning: array subscript has type ‘char’ [-Wchar-subscripts] 26 | if ( v[a[1]] > v[a[2]] ) { | ^ limbaj.cpp:27:13: error: ‘s’ was not declared in this scope 27 | s.push("da"); | ^ limbaj.cpp:30:13: error: ‘s’ was not declared in this scope 30 | s.push("nu"); | ^ limbaj.cpp:34:20: warning: array subscript has type ‘char’ [-Wchar-subscripts] 34 | if ( v[a[1]] < v[a[2]] ) { | ^ limbaj.cpp:34:30: warning: array subscript has type ‘char’ [-Wchar-subscripts] 34 | if ( v[a[1]] < v[a[2]] ) { | ^ limbaj.cpp:35:13: error: ‘s’ was not declared in this scope 35 | s.push("da"); | ^ limbaj.cpp:38:13: error: ‘s’ was not declared in this scope 38 | s.push("nu"); | ^ limbaj.cpp: In function ‘void idk2()’: limbaj.cpp:49:19: warning: array subscript has type ‘char’ [-Wchar-subscripts] 49 | v[a[0]] = v[a[2]]; | ^ limbaj.cpp:49:29: warning: array subscript has type ‘char’ [-Wchar-subscripts] 49 | v[a[0]] = v[a[2]]; | ^ limbaj.cpp:57:5: error: ‘s’ was not declared in this scope 57 | s.pop(); | ^ limbaj.cpp: In function ‘void idk()’: limbaj.cpp:62:9: error: ‘s’ was not declared in this scope 62 | s.pop(); | ^ limbaj.cpp:70:19: error: ‘s’ was not declared in this scope 70 | if ( a == s.top() ) { | ^ limbaj.cpp:75:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] 75 | v[a[0]] = v[a[2]]; | ^ limbaj.cpp:75:37: warning: array subscript has type ‘char’ [-Wchar-subscripts] 75 | v[a[0]] = v[a[2]]; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema limbaj 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ă.