#671
Inordine
Se dă un arbore binar care conține valori numere naturale. Să se afișeze valorile din arbore în urma parcurgerii în inordine.
Problema | Inordine | Operații I/O |
inordine.in /inordine.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #8832169 | Utilizator | |
Fișier | inordine.cpp | Dimensiune | 408 B |
Data încărcării | 14 Martie 2018, 13:22 | Scor / rezultat | Eroare de compilare |
inordine.cpp:5:13: error: expected constructor, destructor, or type conversion before '(' token ofstreamfout("inordine.out"); ^ inordine.cpp:6:1: error: 'intst' does not name a type intst[1001],dr[1001],x[1001]; ^ inordine.cpp:7:1: error: 'intr' does not name a type intr,s; ^ inordine.cpp: In function 'void SRD(int)': inordine.cpp:13:5: error: 'st' was not declared in this scope SRD(st[r]); ^ inordine.cpp:14:1: error: 'fout' was not declared in this scope fout<<x[r]<<' '; ^ inordine.cpp:14:7: error: 'x' was not declared in this scope fout<<x[r]<<' '; ^ inordine.cpp:15:5: error: 'dr' was not declared in this scope SRD(dr[r]); ^ inordine.cpp: In function 'int main()': inordine.cpp:20:1: error: 'intn' was not declared in this scope intn,i; ^ inordine.cpp:20:6: error: 'i' was not declared in this scope intn,i; ^ inordine.cpp:21:6: error: 'n' was not declared in this scope fin>>n; ^ inordine.cpp:24:6: error: 'x' was not declared in this scope fin>>x[i]>>st[i]>>dr[i]; ^ inordine.cpp:24:12: error: 'st' was not declared in this scope fin>>x[i]>>st[i]>>dr[i]; ^ inordine.cpp:24:19: error: 'dr' was not declared in this scope fin>>x[i]>>st[i]>>dr[i]; ^ inordine.cpp:25:9: error: 's' was not declared in this scope s=s+st[i]+dr[i]; ^ inordine.cpp:27:5: error: 'r' was not declared in this scope r=n*(n+1)/2-s ; ^ inordine.cpp:27:17: error: 's' was not declared in this scope r=n*(n+1)/2-s ; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Inordine 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ă.