Detalii evaluare #58409688

Rezumat problemă

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.

Programul citește lista valorilor din arbore, data în ordinea parcurgerii în preordine.

Detalii

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 #58409688 Utilizator Emanuel Schipor (XrozorYula)
Fișier biarbore.cpp Dimensiune 443 B
Data încărcării 02 Iunie 2025, 16:28 Scor / rezultat Eroare de compilare

Evaluare

Mesaj compilare

biarbore.cpp:6:1: error: stray '\342' in program
 ifstream f(“biarbore.in”);

 ^
biarbore.cpp:6:1: error: stray '\200' in program
biarbore.cpp:6:1: error: stray '\234' in program
biarbore.cpp:6:1: error: stray '\342' in program
biarbore.cpp:6:1: error: stray '\200' in program
biarbore.cpp:6:1: error: stray '\235' in program
biarbore.cpp:7:1: error: stray '\342' in program
 ofstream g(“biarbore.out”);

 ^
biarbore.cpp:7:1: error: stray '\200' in program
biarbore.cpp:7:1: error: stray '\234' in program
biarbore.cpp:7:1: error: stray '\342' in program
biarbore.cpp:7:1: error: stray '\200' in program
biarbore.cpp:7:1: error: stray '\235' in program
biarbore.cpp:13:1: error: stray '\342' in program
 { citire(p); if(p->s==NULL) g<<“0”<<’ ‘; else g<<p->s->info<<’ ‘; if(p->d==NULL) g<<“0”<<’ ‘; else g<<p->d->info<<’ ‘; return 0;
 ^
biarbore.cpp:13:1: error: stray '\200' in program
biarbore.cpp:13:1: error: stray '\234' in program
biarbore.cpp:13:1: error: stray '\342' in program
biarbore.cpp:13:1: error: stray '\200' in program
biarbore.cpp:13:1: error: stray '\235' in program
biarbore.cpp:13:1: error: stray '\342' in program
biarbore.cpp:13:1: error: stray '\200' in program
biarbore.cpp:13:1: error: stray '\231' in program
biarbore.cpp:13:1: error: stray '\342' in program
biarbore.cpp:13:1: error: stray '\200' in program
biarbore.cpp:13:1: error: stray '\230' in program
biarbore.cpp:13:1: error: stray '\342' in program
biarbore.cpp:13:1: error: stray '\200' in program
biarbore.cpp:13:1: error: stray '\231' in program
biarbore.cpp:13:1: error: stray '\342' in program
biarbore.cpp:13:1: error: stray '\200' in program
biarbore.cpp:13:1: error: stray '\230' in program
biarbore.cpp:13:1: error: stray '\342' in program
biarbore.cpp:13:1: error: stray '\200' in program
biarbore.cpp:13:1: error: stray '\234' in program
biarbore.cpp:13:1: error: stray '\342' in program
biarbore.cpp:13:1: error: stray '\200' in program
biarbore.cpp:13:1: error: stray '\235' in program
biarbore.cpp:13:1: error: stray '\342' in program
biarbore.cpp:13:1: error: stray '\200' in program
biarbore.cpp:13:1: error: stray '\231' in program
biarbore.cpp:13:1: error: stray '\342' in program
biarbore.cpp:13:1: error: stray '\200' in program
biarbore.cpp:13:1: error: stray '\230' in program
biarbore.cpp:13:1: error: stray '\342' in program
biarbore.cpp:13:1: error: stray '\200' in program
biarbore.cpp:13:1: error: stray '\231' in program
biarbore.cpp:13:1: error: stray '\342' in program
biarbore.cpp:13:1: error: stray '\200' in program
biarbore.cpp:13:1: error: stray '\230' in program
biarbore.cpp:6:15: error: 'biarbore' was not declared in this scope
 ifstream f(“biarbore.in”);

               ^
biarbore.cpp:7:15: error: 'biarbore' was not declared in this scope
 ofstream g(“biarbore.out”);

               ^
biarbore.cpp: In function 'int main()':
biarbore.cpp:13:48: error: expected primary-expression before ';' token
 { citire(p); if(p->s==NULL) g<<“0”<<’ ‘; else g<<p->s->info<<’ ‘; if(p->d==NULL) g<<“0”<<’ ‘; else g<<p->d->info<<’ ‘; return 0;
                                                ^
biarbore.cpp:13:77: error: expected primary-expression before ';' token
 { citire(p); if(p->s==NULL) g<<“0”<<’ ‘; else g<<p->s->info<<’ ‘; if(p->d==NULL) g<<“0”<<’ ‘; else g<<p->d->info<<’ ‘; return 0;
                                                                             ^
biarbore.cpp:13:113: error: expected primary-expression before ';' token
 { citire(p); if(p->s==NULL) g<<“0”<<’ ‘; else g<<p->s->info<<’ ‘; if(p->d==NULL) g<<“0”<<’ ‘; else g<<p->d->info<<’ ‘; return 0;
                                                                                                                 ^
biarbore.cpp:13:142: error: expected primary-expression before ';' token
 { citire(p); if(p->s==NULL) g<<“0”<<’ ‘; else g<<p->s->info<<’ ‘; if(p->d==NULL) g<<“0”<<’ ‘; else g<<p->d->info<<’ ‘; return 0;
                                                                                                                                              ^
biarbore.cpp:13:152: error: expected '}' at end of input
 { citire(p); if(p->s==NULL) g<<“0”<<’ ‘; else g<<p->s->info<<’ ‘; if(p->d==NULL) g<<“0”<<’ ‘; else g<<p->d->info<<’ ‘; return 0;
                                                                                                                                                        ^

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema BiArbore face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.

Du-te sus!