#1178
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 |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64512852 | Utilizator | |
| Fișier | flistastergere2.cpp | Dimensiune | 142 B |
| Data încărcării | 12 Mai 2026, 08:23 | Scor/rezultat | Eroare de compilare |
flistastergere2.cpp: In function ‘void sterge(nod*&)’: flistastergere2.cpp:46:1: error: a function-definition is not allowed here before ‘{’ token 46 | { | ^ flistastergere2.cpp:57:1: error: a function-definition is not allowed here before ‘{’ token 57 | { | ^ flistastergere2.cpp:66:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 66 | int main() | ^~ flistastergere2.cpp:66:9: note: remove parentheses to default-initialize a variable 66 | int main() | ^~ | -- flistastergere2.cpp:66:9: note: or replace parentheses with braces to value-initialize a variable flistastergere2.cpp:67:1: error: a function-definition is not allowed here before ‘{’ token 67 | { | ^ flistastergere2.cpp:80:2: error: expected ‘}’ at end of input 80 | } | ^ flistastergere2.cpp:37:24: note: to match this ‘{’ 37 | void sterge(nod * & 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ă.