#1177
Să se scrie o funcție C++ care determină și șterge dintr-o lista simplu înlănțuită un element dat.
| Problema | FListaStergere1 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64506572 | Utilizator | |
| Fișier | flistastergere1.cpp | Dimensiune | 1.18 KB |
| Data încărcării | 11 Mai 2026, 18:16 | Scor/rezultat | Eroare de compilare |
flistastergere1.cpp:41:8: error: redefinition of ‘struct nod’ 41 | struct nod{ | ^~~ flistastergere1.cpp:4:8: note: previous definition of ‘struct nod’ 4 | struct nod{ | ^~~ flistastergere1.cpp:54:6: error: redefinition of ‘void afisare(nod*)’ 54 | void afisare (nod *p) | ^~~~~~~ flistastergere1.cpp:28:6: note: ‘void afisare(nod*)’ previously defined here 28 | void afisare(nod * p) | ^~~~~~~ flistastergere1.cpp: In function ‘int main()’: flistastergere1.cpp:118:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 118 | for(i=1;i<=n;i++) | ^~~ flistastergere1.cpp:122:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 122 | afisare(p); | ^~~~~~~ flistastergere1.cpp:102:18: warning: unused variable ‘k’ [-Wunused-variable] 102 | int n, i, x, k; | ^ flistastergere1.cpp: At global scope: flistastergere1.cpp:139:5: error: redefinition of ‘int main()’ 139 | int main() | ^~~~ flistastergere1.cpp:98:5: note: ‘int main()’ previously defined here 98 | int main() | ^~~~ flistastergere1.cpp: In function ‘int main()’: flistastergere1.cpp:151:9: error: ‘sterge’ was not declared in this scope; did you mean ‘stergeTot’? 151 | sterge(p , q); | ^~~~~~ | stergeTot
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FListaStergere1 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ă.