#1169
Să se scrie o funcție C++ care afișează pe ecran valorile memorate într-o lista simplu înlănțuită.
| Problema | FAfisareLista | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64818317 | Utilizator | |
| Fișier | fafisarelista.cpp | Dimensiune | 917 B |
| Data încărcării | 03 Iunie 2026, 13:16 | Scor/rezultat | Eroare de compilare |
fafisarelista.cpp:31:8: error: redefinition of ‘struct nod’ 31 | struct nod{ | ^~~ fafisarelista.cpp:4:8: note: previous definition of ‘struct nod’ 4 | struct nod{ | ^~~ fafisarelista.cpp: In function ‘int top(nod*)’: fafisarelista.cpp:67:1: warning: no return statement in function returning non-void [-Wreturn-type] 67 | } | ^ fafisarelista.cpp: In function ‘int main()’: fafisarelista.cpp:78:9: error: invalid initialization of reference of type ‘nod*&’ from expression of type ‘int*’ 78 | pop(vf); | ^~ fafisarelista.cpp:54:16: note: in passing argument 1 of ‘void pop(nod*&)’ 54 | void pop(nod *&vf) | ~~~~~~^~ fafisarelista.cpp:82:10: error: invalid initialization of reference of type ‘nod*&’ from expression of type ‘int*’ 82 | push(vf,x); | ^~ fafisarelista.cpp:41:16: note: in passing argument 1 of ‘void push(nod*&, int)’ 41 | void push(nod*&vf,int x) | ~~~~~^~ fafisarelista.cpp:86:9: error: cannot convert ‘int*’ to ‘nod*’ 86 | top(vf); | ^~ | | | int* fafisarelista.cpp:63:14: note: initializing argument 1 of ‘int top(nod*)’ 63 | int top(nod *vf) | ~~~~~^~ fafisarelista.cpp: At global scope: fafisarelista.cpp:118:5: error: redefinition of ‘int main()’ 118 | int main() | ^~~~ fafisarelista.cpp:69:5: note: ‘int main()’ previously defined here 69 | int main() | ^~~~ fafisarelista.cpp: In function ‘int main()’: fafisarelista.cpp:124:16: error: too few arguments to function ‘void afisare(nod*, int)’ 124 | afisare(p); | ~~~~~~~^~~ fafisarelista.cpp:94:6: note: declared here 94 | void afisare(nod * p, int rest) | ^~~~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FAfisareLista 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ă.