#791
Se consideră un arbore binar în care nodurile memorează numere naturale nenule. Să se afișeze valorile memorate în nodurile terminale ale arborelui, în ordine crescătoare.
Programul citește lista valorilor din arbore, dată în ordinea parcurgerii în preordine.
| Problema | BiFrunze1 | Operații I/O |
bifrunze1.in/bifrunze1.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64195629 | Utilizator | |
| Fișier | bifrunze1.cpp | Dimensiune | 1019 B |
| Data încărcării | 22 Aprilie 2026, 12:57 | Scor/rezultat | Eroare de compilare |
bifrunze1.cpp:4:29: error: no matching function for call to ‘std::basic_ostream<char>::basic_ostream(const char [13])’ 4 | ostream g("bifrunze.out"); | ^ In file included from /usr/include/c++/13/istream:41, from /usr/include/c++/13/fstream:40, from bifrunze1.cpp:1: /usr/include/c++/13/ostream:436:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::basic_ostream(std::basic_iostream<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’ 436 | basic_ostream(basic_iostream<_CharT, _Traits>&) { } | ^~~~~~~~~~~~~ /usr/include/c++/13/ostream:436:21: note: no known conversion for argument 1 from ‘const char [13]’ to ‘std::basic_iostream<char>&’ 436 | basic_ostream(basic_iostream<_CharT, _Traits>&) { } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/ostream:440:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::basic_ostream(std::basic_ostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]’ 440 | basic_ostream(basic_ostream&& __rhs) | ^~~~~~~~~~~~~ /usr/include/c++/13/ostream:440:37: note: no known conversion for argument 1 from ‘const char [13]’ to ‘std::basic_ostream<char>&&’ 440 | basic_ostream(basic_ostream&& __rhs) | ~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/13/ostream:431:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::basic_ostream() [with _CharT = char; _Traits = std::char_traits<char>]’ 431 | basic_ostream() | ^~~~~~~~~~~~~ /usr/include/c++/13/ostream:431:7: note: candidate expects 0 arguments, 1 provided /usr/include/c++/13/ostream:86:7: note: candidate: ‘std::basic_ostream<_CharT, _Traits>::basic_ostream(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]’ 86 | basic_ostream(__streambuf_type* __sb) | ^~~~~~~~~~~~~ /usr/include/c++/13/ostream:86:39: note: no known conversion for argument 1 from ‘const char [13]’ to ‘std::basic_ostream<char>::__streambuf_type*’ {aka ‘std::basic_streambuf<char>*’} 86 | basic_ostream(__streambuf_type* __sb) | ~~~~~~~~~~~~~~~~~~^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema BiFrunze1 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ă.