#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 | #29593178 | Utilizator | |
Fișier | biarbore.cpp | Dimensiune | 589 B |
Data încărcării | 11 Mai 2021, 10:34 | Scor / rezultat | Eroare de compilare |
biarbore.cpp:3:12: warning: missing terminating " character [enabled by default] ifstream f("biarbore.in); ^ biarbore.cpp:3:1: error: missing terminating " character ifstream f("biarbore.in); ^ biarbore.cpp:4:12: warning: missing terminating " character [enabled by default] ofstream g("biarbore.out); ^ biarbore.cpp:4:1: error: missing terminating " character ofstream g("biarbore.out); ^ biarbore.cpp:5:12: error: types may not be defined in parameter types struct nod {int info; ^ biarbore.cpp:6:27: error: expected ')' before ';' token nod *st, *dr;}; ^ biarbore.cpp:6:27: error: expected ')' before ';' token biarbore.cpp: In function 'void creare(nod&)': biarbore.cpp:10:5: error: invalid operands of types 'std::ifstream(std::ofstream (*)(nod)) {aka std::basic_ifstream<char>(std::basic_ofstream<char> (*)(nod))}' and 'int' to binary 'operator>>' f>>x; ^ biarbore.cpp:12:4: error: no match for 'operator=' (operand types are 'nod' and 'nod*') {r=new(nod); ^ biarbore.cpp:12:4: note: candidates are: biarbore.cpp:5:8: note: nod& nod::operator=(const nod&) struct nod {int info; ^ biarbore.cpp:5:8: note: no known conversion for argument 1 from 'nod*' to 'const nod&' biarbore.cpp:5:8: note: nod& nod::operator=(nod&&) biarbore.cpp:5:8: note: no known conversion for argument 1 from 'nod*' to 'nod&&' biarbore.cpp:13:4: error: base operand of '->' has non-pointer type 'nod' r->info=x; ^ biarbore.cpp:14:11: error: base operand of '->' has non-pointer type 'nod' creare(r->st); ^ biarbore.cpp:15:11: error: base operand of '->' has non-pointer type 'nod' creare(r->dr);} ^ biarbore.cpp:16:9: error: no match for 'operator=' (operand types are 'nod' and 'int') else r=NULL; ^ biarbore.cpp:16:9: note: candidates are: biarbore.cpp:5:8: note: nod& nod::operator=(const nod&) struct nod {int info; ^ biarbore.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'const nod&' biarbore.cpp:5:8: note: nod& nod::operator=(nod&&) biarbore.cpp:5:8: note: no known conversion for argument 1 from 'int' to 'nod&&' biarbore.cpp: In function 'int main()': biarbore.cpp:20:20: error: 'rad' was not declared in this scope {creare(rad); ^ biarbore.cpp:22:32: error: 'g' was not declared in this scope {if(rad->st!=NULL) g<<rad->st->info<<' '; ^ biarbore.cpp:23:19: error: 'g' was not declared in this scope else g<<'0'; ^ biarbore.cpp:24:32: error: 'g' was not declared in this scope if(rad->dr!=NULL) g<<rad->st->info<<' '; ^ biarbore.cpp:25:20: error: 'g' was not declared in this scope else g<<"0"; ^ biarbore.cpp:27:13: error: 'retunr' was not declared in this scope retunr 0;} ^ biarbore.cpp:27:20: error: expected ';' before numeric constant retunr 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ă.