#759
Se consideră un arbore binar în care nodurile memorează numere naturale nenule. Să se afișeze valorile din arbore în urma parcurgerii în lățime, pornind din rădăcină.
Programul citește lista valorilor din arbore, dată în ordinea parcurgerii în preordine.
| Problema | BiLatime | Operații I/O |
bilatime.in/bilatime.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64674711 | Utilizator | |
| Fișier | bilatime.cpp | Dimensiune | 902 B |
| Data încărcării | 21 Mai 2026, 21:25 | Scor/rezultat | Eroare de compilare |
bilatime.cpp:1:1: error: ‘nclude’ does not name a type 1 | nclude <fstream> | ^~~~~~ bilatime.cpp:3:1: error: ‘ifstream’ does not name a type 3 | ifstream f("bilatime.in"); | ^~~~~~~~ bilatime.cpp:4:1: error: ‘ofstream’ does not name a type 4 | ofstream g("bilatime.out"); | ^~~~~~~~ bilatime.cpp: In function ‘void creare(nod*&, int)’: bilatime.cpp:13:13: error: ‘NULL’ was not declared in this scope 13 | r->st=r->dr=NULL; | ^~~~ bilatime.cpp:1:1: note: ‘NULL’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’? +++ |+#include <cstddef> 1 | nclude <fstream> bilatime.cpp:15:1: error: ‘f’ was not declared in this scope 15 | f>>y; | ^ bilatime.cpp: In function ‘void afisare(nod*)’: bilatime.cpp:21:8: error: ‘NULL’ was not declared in this scope 21 | {if(r==NULL) | ^~~~ bilatime.cpp:21:8: note: ‘NULL’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’? bilatime.cpp:30:1: error: ‘g’ was not declared in this scope 30 | g<<p->info<<" "; //afisez v-prim e pt stanga, ultim e pentru dreapta; | ^ bilatime.cpp:31:11: error: ‘NULL’ was not declared in this scope 31 | if(p->st!=NULL) //verific daca exista un fiu stang si l salvez in vector | ^~~~ bilatime.cpp:31:11: note: ‘NULL’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’? bilatime.cpp:33:11: error: ‘NULL’ was not declared in this scope 33 | if(p->dr!=NULL) //verific daca exista fiu drept si l salvez in vector | ^~~~ bilatime.cpp:33:11: note: ‘NULL’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’? bilatime.cpp: In function ‘int main()’: bilatime.cpp:38:8: error: ‘NULL’ was not declared in this scope 38 | {nod*r=NULL; | ^~~~ bilatime.cpp:38:8: note: ‘NULL’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’? bilatime.cpp:40:1: error: ‘f’ was not declared in this scope 40 | f>>x; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema BiLatime 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ă.