#752
BiArbore
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.
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 | #29592847 | Utilizator | |
Fișier | biarbore.cpp | Dimensiune | 705 B |
Data încărcării | 11 Mai 2021, 10:25 | Scor / rezultat | Eroare de compilare |
biarbore.cpp:3:13: error: variable 'std::ifstream in' has initializer but incomplete type ifstream in ("biarbore.in"); ^ biarbore.cpp:4:14: error: variable 'std::ofstream out' has initializer but incomplete type ofstream out ("biarbore.out"); ^ biarbore.cpp: In function 'void afis(nod*)': biarbore.cpp:26:2: error: 'g' was not declared in this scope {g<<r->info<<' ' : ^ biarbore.cpp:26:18: error: expected ';' before ':' token {g<<r->info<<' ' : ^ biarbore.cpp:28:16: error: 'afis_rsd' was not declared in this scope afis_rsd(r->dr); ^ biarbore.cpp:31:28: error: 'numarare' was not declared in this scope return 1+numarare(r->st)+numarare(r->dr); ^ biarbore.cpp:31:44: error: return-statement with a value, in function returning 'void' [-fpermissive] return 1+numarare(r->st)+numarare(r->dr); ^ biarbore.cpp:33:31: error: 'numarare' was not declared in this scope return numarare (r->st)+numarare(r->dr); ^ biarbore.cpp:33:47: error: return-statement with a value, in function returning 'void' [-fpermissive] return numarare (r->st)+numarare(r->dr); ^ biarbore.cpp: In function 'int main()': biarbore.cpp:38:18: error: 'g' was not declared in this scope if(r->st!=NULL) g<<r->st->info<<' '; ^ biarbore.cpp:39:7: error: 'g' was not declared in this scope else g<<"0"; ^ biarbore.cpp:40:17: error: 'g' was not declared in this scope if(r->dr!=NULL) g<<r->dr->info<<' '; ^ biarbore.cpp:41:8: error: 'g' was not declared in this scope else g<<"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ă.