#4685
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 | #63993220 | Utilizator | |
| Fișier | ldistergeab.cpp | Dimensiune | 972 B |
| Data încărcării | 02 Aprilie 2026, 16:30 | Scor/rezultat | Eroare de compilare |
ldistergeab.cpp: In function 'void StergeAB(nod*&, nod*&, int, int)': ldistergeab.cpp:17:21: error: no matching function for call to 'nod::nod()' nod q = new nod(); ^ ldistergeab.cpp:17:21: 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:6: error: invalid user-defined conversion from 'nod*' to 'nod&&' [-fpermissive] q=prim; ^ ldistergeab.cpp:8:5: note: candidate is: nod::nod(int) <near match> nod(int x) ^ ldistergeab.cpp:8:5: note: no known conversion for argument 1 from 'nod*' to 'int' ldistergeab.cpp:18:6: error: invalid conversion from 'nod*' to 'int' [-fpermissive] q=prim; ^ ldistergeab.cpp:8:5: error: initializing argument 1 of 'nod::nod(int)' [-fpermissive] nod(int x) ^ ldistergeab.cpp:18:6: error: conversion to non-const reference type 'struct nod&&' from rvalue of type 'nod' [-fpermissive] q=prim; ^ ldistergeab.cpp:19:12: error: could not convert 'q' from 'nod' to 'bool' while (q!NULL) ^ ldistergeab.cpp:19:13: error: expected ')' before '!' token while (q!NULL) ^ ldistergeab.cpp:19:18: error: expected ';' before ')' token while (q!NULL) ^ ldistergeab.cpp:92:1: warning: statement has no effect [-Wunused-value] } ^ ldistergeab.cpp:92:1: error: expected '}' at end of input
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ă.