#1178
FListaStergere2
C++
Să se scrie o funcție C++ care șterge dintr-o lista simplu înlănțuită toate elementele pare.
Problema | FListaStergere2 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51371215 | Utilizator | |
Fișier | flistastergere2.cpp | Dimensiune | 1.10 KB |
Data încărcării | 11 Iunie 2024, 09:50 | Scor / rezultat | Eroare de compilare |
flistastergere2.cpp:40:8: error: redefinition of 'struct nod' struct nod ^ flistastergere2.cpp:4:8: error: previous definition of 'struct nod' struct nod{ ^ flistastergere2.cpp:44:7: error: invalid type in declaration before ',' token }*prim,*ultim; ^ flistastergere2.cpp: In function 'int main()': flistastergere2.cpp:103:28: error: invalid initialization of reference of type 'nod*&' from expression of type 'int*' creare(prim,ultim,x); ^ flistastergere2.cpp:45:6: error: in passing argument 1 of 'void creare(nod*&, nod*&, int)' void creare(nod*&prim,nod*&ultim,int x) ^ flistastergere2.cpp:105:23: error: no matching function for call to 'afisare(int*&, int*&)' afisare(prim,ultim); ^ flistastergere2.cpp:105:23: note: candidates are: flistastergere2.cpp:28:6: note: void afisare(nod*) void afisare(nod * p) ^ flistastergere2.cpp:28:6: note: candidate expects 1 argument, 2 provided flistastergere2.cpp:63:6: note: void afisare(nod*, nod*) void afisare(nod*prim,nod*ultim) ^ flistastergere2.cpp:63:6: note: no known conversion for argument 1 from 'int*' to 'nod*' flistastergere2.cpp:106:26: error: cannot convert 'int*' to 'nod*' for argument '1' to 'void parcurgere(nod*, nod*)' parcurgere(prim,ultim); ^ flistastergere2.cpp:107:23: error: no matching function for call to 'afisare(int*&, int*&)' afisare(prim,ultim); ^ flistastergere2.cpp:107:23: note: candidates are: flistastergere2.cpp:28:6: note: void afisare(nod*) void afisare(nod * p) ^ flistastergere2.cpp:28:6: note: candidate expects 1 argument, 2 provided flistastergere2.cpp:63:6: note: void afisare(nod*, nod*) void afisare(nod*prim,nod*ultim) ^ flistastergere2.cpp:63:6: note: no known conversion for argument 1 from 'int*' to 'nod*' flistastergere2.cpp: In function 'int main()': flistastergere2.cpp:131:5: error: redefinition of 'int main()' int main() ^ flistastergere2.cpp:95:5: error: 'int main()' previously defined here int main() ^ flistastergere2.cpp:141:10: error: 'sterge' was not declared in this scope sterge(p); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FListaStergere2 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ă.