#752
Se consideră un arbore binar alocat dinamic în care nodurile memorează numere naturale nenule. Să se determine valorile memorate în descendenții direcți ai rădăcinii arborelui.
Programul citește lista valorilor din arbore, data în ordinea parcurgerii în preordine.
Problema | BiArbore | Operații I/O |
![]() biarbore.in /biarbore.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58409688 | Utilizator | |
Fișier | biarbore.cpp | Dimensiune | 443 B |
Data încărcării | 02 Iunie 2025, 16:28 | Scor / rezultat | Eroare de compilare |
biarbore.cpp:6:1: error: stray '\342' in program ifstream f(“biarbore.in”); ^ biarbore.cpp:6:1: error: stray '\200' in program biarbore.cpp:6:1: error: stray '\234' in program biarbore.cpp:6:1: error: stray '\342' in program biarbore.cpp:6:1: error: stray '\200' in program biarbore.cpp:6:1: error: stray '\235' in program biarbore.cpp:7:1: error: stray '\342' in program ofstream g(“biarbore.out”); ^ biarbore.cpp:7:1: error: stray '\200' in program biarbore.cpp:7:1: error: stray '\234' in program biarbore.cpp:7:1: error: stray '\342' in program biarbore.cpp:7:1: error: stray '\200' in program biarbore.cpp:7:1: error: stray '\235' in program biarbore.cpp:13:1: error: stray '\342' in program { citire(p); if(p->s==NULL) g<<“0”<<’ ‘; else g<<p->s->info<<’ ‘; if(p->d==NULL) g<<“0”<<’ ‘; else g<<p->d->info<<’ ‘; return 0; ^ biarbore.cpp:13:1: error: stray '\200' in program biarbore.cpp:13:1: error: stray '\234' in program biarbore.cpp:13:1: error: stray '\342' in program biarbore.cpp:13:1: error: stray '\200' in program biarbore.cpp:13:1: error: stray '\235' in program biarbore.cpp:13:1: error: stray '\342' in program biarbore.cpp:13:1: error: stray '\200' in program biarbore.cpp:13:1: error: stray '\231' in program biarbore.cpp:13:1: error: stray '\342' in program biarbore.cpp:13:1: error: stray '\200' in program biarbore.cpp:13:1: error: stray '\230' in program biarbore.cpp:13:1: error: stray '\342' in program biarbore.cpp:13:1: error: stray '\200' in program biarbore.cpp:13:1: error: stray '\231' in program biarbore.cpp:13:1: error: stray '\342' in program biarbore.cpp:13:1: error: stray '\200' in program biarbore.cpp:13:1: error: stray '\230' in program biarbore.cpp:13:1: error: stray '\342' in program biarbore.cpp:13:1: error: stray '\200' in program biarbore.cpp:13:1: error: stray '\234' in program biarbore.cpp:13:1: error: stray '\342' in program biarbore.cpp:13:1: error: stray '\200' in program biarbore.cpp:13:1: error: stray '\235' in program biarbore.cpp:13:1: error: stray '\342' in program biarbore.cpp:13:1: error: stray '\200' in program biarbore.cpp:13:1: error: stray '\231' in program biarbore.cpp:13:1: error: stray '\342' in program biarbore.cpp:13:1: error: stray '\200' in program biarbore.cpp:13:1: error: stray '\230' in program biarbore.cpp:13:1: error: stray '\342' in program biarbore.cpp:13:1: error: stray '\200' in program biarbore.cpp:13:1: error: stray '\231' in program biarbore.cpp:13:1: error: stray '\342' in program biarbore.cpp:13:1: error: stray '\200' in program biarbore.cpp:13:1: error: stray '\230' in program biarbore.cpp:6:15: error: 'biarbore' was not declared in this scope ifstream f(“biarbore.in”); ^ biarbore.cpp:7:15: error: 'biarbore' was not declared in this scope ofstream g(“biarbore.out”); ^ biarbore.cpp: In function 'int main()': biarbore.cpp:13:48: error: expected primary-expression before ';' token { citire(p); if(p->s==NULL) g<<“0”<<’ ‘; else g<<p->s->info<<’ ‘; if(p->d==NULL) g<<“0”<<’ ‘; else g<<p->d->info<<’ ‘; return 0; ^ biarbore.cpp:13:77: error: expected primary-expression before ';' token { citire(p); if(p->s==NULL) g<<“0”<<’ ‘; else g<<p->s->info<<’ ‘; if(p->d==NULL) g<<“0”<<’ ‘; else g<<p->d->info<<’ ‘; return 0; ^ biarbore.cpp:13:113: error: expected primary-expression before ';' token { citire(p); if(p->s==NULL) g<<“0”<<’ ‘; else g<<p->s->info<<’ ‘; if(p->d==NULL) g<<“0”<<’ ‘; else g<<p->d->info<<’ ‘; return 0; ^ biarbore.cpp:13:142: error: expected primary-expression before ';' token { citire(p); if(p->s==NULL) g<<“0”<<’ ‘; else g<<p->s->info<<’ ‘; if(p->d==NULL) g<<“0”<<’ ‘; else g<<p->d->info<<’ ‘; return 0; ^ biarbore.cpp:13:152: error: expected '}' at end of input { citire(p); if(p->s==NULL) g<<“0”<<’ ‘; else g<<p->s->info<<’ ‘; if(p->d==NULL) g<<“0”<<’ ‘; else g<<p->d->info<<’ ‘; return 0; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema BiArbore 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ă.