#1169
FAfisareLista
C++
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 | #52041681 | Utilizator | |
Fișier | fafisarelista.cpp | Dimensiune | 649 B |
Data încărcării | 17 Septembrie 2024, 11:59 | Scor / rezultat | Eroare de compilare |
fafisarelista.cpp:32:8: error: redefinition of 'struct nod' struct nod{ ^ fafisarelista.cpp:4:8: error: previous definition of 'struct nod' struct nod{ ^ fafisarelista.cpp:35:5: error: invalid type in declaration before ',' token } *p, *u, *q,*w; ^ fafisarelista.cpp: In function 'void Crearea(nod*&)': fafisarelista.cpp:46:26: error: cannot convert 'nod*' to 'int*' in assignment u=p; ^ fafisarelista.cpp:47:28: error: request for member 'urm' in '* u', which is of non-class type 'int' u->urm=NULL;} ^ fafisarelista.cpp:48:16: error: cannot convert 'nod*' to 'int*' in assignment else {q=new nod; ^ fafisarelista.cpp:49:20: error: request for member 'info' in '* q', which is of non-class type 'int' q->info=x; ^ fafisarelista.cpp:50:20: error: request for member 'urm' in '* u', which is of non-class type 'int' u->urm=q; ^ fafisarelista.cpp:52:20: error: request for member 'urm' in '* u', which is of non-class type 'int' u->urm=NULL;} ^ fafisarelista.cpp: In function 'void afisare()': fafisarelista.cpp:60:18: error: request for member 'info' in '* q', which is of non-class type 'int' cout<<q->info<<" "; ^ fafisarelista.cpp:61:14: error: request for member 'urm' in '* q', which is of non-class type 'int' q=q->urm; ^ fafisarelista.cpp: In function 'int main()': fafisarelista.cpp:67:10: error: invalid initialization of reference of type 'nod*&' from expression of type 'int*' Crearea(p); ^ fafisarelista.cpp:39:6: error: in passing argument 1 of 'void Crearea(nod*&)' void Crearea(nod * & p) ^ fafisarelista.cpp: In function 'int main()': fafisarelista.cpp:96:5: error: redefinition of 'int main()' int main() ^ fafisarelista.cpp:65:5: error: 'int main()' previously defined here int main() ^ fafisarelista.cpp:102:11: error: no matching function for call to 'afisare(nod*&)' afisare(p); ^ fafisarelista.cpp:102:11: note: candidates are: fafisarelista.cpp:56:6: note: void afisare() void afisare() ^ fafisarelista.cpp:56:6: note: candidate expects 0 arguments, 1 provided fafisarelista.cpp:72:6: note: void afisare(nod*, int) void afisare(nod * p, int rest) ^ fafisarelista.cpp:72:6: note: candidate expects 2 arguments, 1 provided
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ă.