#4682
Să se scrie funcția Erase care va șterge dintr-o listă dublu înlănțuită toate nodurile care memorează numere pare. De exemplu, dacă lista reține valorile 5,3,6,2,1,8, atunci după apelul Erase(prim, ultim), lista va fi 5,3,1.
| Problema | FLdiErase | Operații I/O |
erase.in/erase.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64429709 | Utilizator | |
| Fișier | fldierase.cpp | Dimensiune | 1.16 KB |
| Data încărcării | 06 Mai 2026, 13:51 | Scor/rezultat | Eroare de compilare |
fldierase.cpp:18:8: error: redefinition of ‘struct nod’ 18 | struct nod | ^~~ fldierase.cpp:4:8: note: previous definition of ‘struct nod’ 4 | struct nod | ^~~ fldierase.cpp: In function ‘int main()’: fldierase.cpp:57:18: error: no matching function for call to ‘nod::nod()’ 57 | p=new nod; | ^~~ fldierase.cpp:8:5: note: candidate: ‘nod::nod(int)’ 8 | nod(int x) | ^~~ fldierase.cpp:8:5: note: candidate expects 1 argument, 0 provided fldierase.cpp:4:8: note: candidate: ‘constexpr nod::nod(const nod&)’ 4 | struct nod | ^~~ fldierase.cpp:4:8: note: candidate expects 1 argument, 0 provided fldierase.cpp:4:8: note: candidate: ‘constexpr nod::nod(nod&&)’ fldierase.cpp:4:8: note: candidate expects 1 argument, 0 provided fldierase.cpp:66:18: error: no matching function for call to ‘nod::nod()’ 66 | q=new nod; | ^~~ fldierase.cpp:8:5: note: candidate: ‘nod::nod(int)’ 8 | nod(int x) | ^~~ fldierase.cpp:8:5: note: candidate expects 1 argument, 0 provided fldierase.cpp:4:8: note: candidate: ‘constexpr nod::nod(const nod&)’ 4 | struct nod | ^~~ fldierase.cpp:4:8: note: candidate expects 1 argument, 0 provided fldierase.cpp:4:8: note: candidate: ‘constexpr nod::nod(nod&&)’ fldierase.cpp:4:8: note: candidate expects 1 argument, 0 provided fldierase.cpp: At global scope: fldierase.cpp:84:5: error: redefinition of ‘int main()’ 84 | int main() | ^~~~ fldierase.cpp:48:5: note: ‘int main()’ previously defined here 48 | int main() | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FLdiErase 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ă.