#4685
LdiStergeAB
C++
Scrieți o funcție care va șterge dintr-o listă dublu înlănțuită primul nod care memorează valoarea A
și ultimul nod care memorează valoarea B
.
Problema | LdiStergeAB | Operații I/O |
![]() ldistergeab.in /ldistergeab.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51370108 | Utilizator | |
Fișier | ldistergeab.cpp | Dimensiune | 263 B |
Data încărcării | 11 Iunie 2024, 09:20 | Scor / rezultat | Eroare de compilare |
ldistergeab.cpp: In function 'void StergeAB(nod*&, nod*&, int, int)': ldistergeab.cpp:17:18: error: no matching function for call to 'nod::nod()' nod *p = new nod; ^ ldistergeab.cpp:17:18: note: candidates are: ldistergeab.cpp:8:5: note: nod::nod(int) nod(int x) ^ ldistergeab.cpp:8:5: note: candidate expects 1 argument, 0 provided ldistergeab.cpp:4:8: note: constexpr nod::nod(const nod&) struct nod ^ ldistergeab.cpp:4:8: note: candidate expects 1 argument, 0 provided ldistergeab.cpp:4:8: note: constexpr nod::nod(nod&&) ldistergeab.cpp:4:8: note: candidate expects 1 argument, 0 provided ldistergeab.cpp:18:18: error: no matching function for call to 'nod::nod()' nod *q = new nod; ^ ldistergeab.cpp:18:18: note: candidates are: ldistergeab.cpp:8:5: note: nod::nod(int) nod(int x) ^ ldistergeab.cpp:8:5: note: candidate expects 1 argument, 0 provided ldistergeab.cpp:4:8: note: constexpr nod::nod(const nod&) struct nod ^ ldistergeab.cpp:4:8: note: candidate expects 1 argument, 0 provided ldistergeab.cpp:4:8: note: constexpr nod::nod(nod&&) ldistergeab.cpp:4:8: note: candidate expects 1 argument, 0 provided ldistergeab.cpp:19:14: warning: statement has no effect [-Wunused-value] p -> urm == q -> ant; ^ ldistergeab.cpp:22:14: error: 'struct nod' has no member named 'prim' p -> prim = A; ^ ldistergeab.cpp:23:14: error: 'struct nod' has no member named 'ultim' q -> ultim = B; ^ ldistergeab.cpp:24:11: warning: statement has no effect [-Wunused-value] p != NULL; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema LdiStergeAB face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.