#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 | #64429788 | Utilizator | |
| Fișier | fldierase.cpp | Dimensiune | 1.05 KB |
| Data încărcării | 06 Mai 2026, 13:53 | 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 ‘void citire(nod*&, nod*&)’: fldierase.cpp:36:20: error: no matching function for call to ‘nod::nod()’ 36 | prim=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:44:16: error: no matching function for call to ‘nod::nod()’ 44 | 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:26:11: warning: unused variable ‘x’ [-Wunused-variable] 26 | int n,x; | ^ fldierase.cpp: In function ‘void afisare(nod*, nod*)’: fldierase.cpp:73:1: error: a function-definition is not allowed here before ‘{’ token 73 | { | ^ fldierase.cpp:76:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 76 | int main() | ^~ fldierase.cpp:76:9: note: remove parentheses to default-initialize a variable 76 | int main() | ^~ | -- fldierase.cpp:76:9: note: or replace parentheses with braces to value-initialize a variable fldierase.cpp:77:1: error: a function-definition is not allowed here before ‘{’ token 77 | { | ^ fldierase.cpp:89:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 89 | int main() | ^~ fldierase.cpp:89:9: note: remove parentheses to default-initialize a variable 89 | int main() | ^~ | -- fldierase.cpp:89:9: note: or replace parentheses with braces to value-initialize a variable fldierase.cpp:90:1: error: a function-definition is not allowed here before ‘{’ token 90 | { | ^ fldierase.cpp:128:2: error: expected ‘}’ at end of input 128 | } | ^ fldierase.cpp:57:1: note: to match this ‘{’ 57 | { q=prim; | ^
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ă.