#1476
Să se scrie o funcție C++ care sortează crescător elementele unei liste simplu înlănţuite.
| Problema | FSortare | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64635450 | Utilizator | |
| Fișier | fsortare.cpp | Dimensiune | 344 B |
| Data încărcării | 19 Mai 2026, 17:23 | Scor/rezultat | Eroare de compilare |
fsortare.cpp: In function ‘void sortareCrescator(nod*&)’: fsortare.cpp:30:20: error: no match for ‘operator=’ (operand types are ‘nod’ and ‘nod*’) 30 | for(q = p->urm; q != NULL; q = q->urm) | ^~~ fsortare.cpp:3:8: note: candidate: ‘nod& nod::operator=(const nod&)’ 3 | struct nod{ | ^~~ fsortare.cpp:3:8: note: no known conversion for argument 1 from ‘nod*’ to ‘const nod&’ fsortare.cpp:3:8: note: candidate: ‘nod& nod::operator=(nod&&)’ fsortare.cpp:3:8: note: no known conversion for argument 1 from ‘nod*’ to ‘nod&&’ fsortare.cpp:30:27: error: no match for ‘operator!=’ (operand types are ‘nod’ and ‘long int’) 30 | for(q = p->urm; q != NULL; q = q->urm) | ^ fsortare.cpp:30:41: error: base operand of ‘->’ has non-pointer type ‘nod’ 30 | for(q = p->urm; q != NULL; q = q->urm) | ^~ fsortare.cpp:32:27: error: base operand of ‘->’ has non-pointer type ‘nod’ 32 | if(p->info > q->info) | ^~ fsortare.cpp:35:28: error: base operand of ‘->’ has non-pointer type ‘nod’ 35 | p->info = q->info; | ^~ fsortare.cpp:36:18: error: base operand of ‘->’ has non-pointer type ‘nod’ 36 | q->info = aux | ^~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FSortare 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ă.