#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 | #22968050 | Utilizator | |
Fișier | biarbore.cpp | Dimensiune | 495 B |
Data încărcării | 15 Mai 2020, 10:19 | Scor / rezultat | Eroare de compilare |
biarbore.cpp:8:5: error: field 's' has incomplete type nod s,d; ^ biarbore.cpp:8:7: error: field 'd' has incomplete type nod s,d; ^ biarbore.cpp: In function 'void creare(nod&)': biarbore.cpp:19:2: error: no match for 'operator=' (operand types are 'nod' and 'int') r=NULL; ^ biarbore.cpp:19:2: note: candidates are: biarbore.cpp:6:8: note: nod& nod::operator=(const nod&) struct nod{ ^ biarbore.cpp:6:8: note: no known conversion for argument 1 from 'int' to 'const nod&' biarbore.cpp:6:8: note: nod& nod::operator=(nod&&) biarbore.cpp:6:8: note: no known conversion for argument 1 from 'int' to 'nod&&' biarbore.cpp:23:2: error: no match for 'operator=' (operand types are 'nod' and 'nod*') r= new nod; ^ biarbore.cpp:23:2: note: candidates are: biarbore.cpp:6:8: note: nod& nod::operator=(const nod&) struct nod{ ^ biarbore.cpp:6:8: note: no known conversion for argument 1 from 'nod*' to 'const nod&' biarbore.cpp:6:8: note: nod& nod::operator=(nod&&) biarbore.cpp:6:8: note: no known conversion for argument 1 from 'nod*' to 'nod&&' biarbore.cpp:24:2: error: base operand of '->' has non-pointer type 'nod' r->inf=n; ^ biarbore.cpp:25:10: error: base operand of '->' has non-pointer type 'nod' creare (r->s); ^ biarbore.cpp:26:10: error: base operand of '->' has non-pointer type 'nod' creare (r->d); ^ biarbore.cpp: At global scope: biarbore.cpp:31:14: error: variable or field 'rsd' declared void void rsd(nodr) ^ biarbore.cpp:31:10: error: 'nodr' was not declared in this scope void rsd(nodr) ^
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ă.