#672
Postordine
Se dă un arbore binar care conține valori numere naturale. Să se afișeze valorile din arbore în urma parcurgerii în postordine.
Problema | Postordine | Operații I/O |
postordine.in /postordine.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #36396496 | Utilizator | |
Fișier | postordine.cpp | Dimensiune | 539 B |
Data încărcării | 27 Aprilie 2022, 20:16 | Scor / rezultat | Eroare de compilare |
postordine.cpp:8:1: error: expected ',' or ';' before 'int' int val[1001],st[1001],dr[1001],t[1001],r,n; ^ postordine.cpp: In function 'void SDR(int)': postordine.cpp:14:13: error: 'st' was not declared in this scope SDR(st[r]); ^ postordine.cpp:15:13: error: 'dr' was not declared in this scope SDR(dr[r]); ^ postordine.cpp:16:15: error: 'val' was not declared in this scope fout<<val[r]<<" "; ^ postordine.cpp: In function 'int main()': postordine.cpp:21:10: error: 'n' was not declared in this scope fin>>n; ^ postordine.cpp:25:14: error: 'val' was not declared in this scope fin>>val[i]>>st[i]>>dr[i]; ^ postordine.cpp:25:22: error: 'st' was not declared in this scope fin>>val[i]>>st[i]>>dr[i]; ^ postordine.cpp:25:29: error: 'dr' was not declared in this scope fin>>val[i]>>st[i]>>dr[i]; ^ postordine.cpp:27:9: error: 't' was not declared in this scope t[st[i]]=i; ^ postordine.cpp:32:12: error: 't' was not declared in this scope if(t[i]==0) r=i; ^ postordine.cpp:32:21: error: 'r' was not declared in this scope if(t[i]==0) r=i; ^ postordine.cpp:34:9: error: 'r' was not declared in this scope SDR(r); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Postordine 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ă.