#2563
Să se scrie o funcție C++ care inserează într-o listă simplu înlănțuită cu elementele ordonate crescător un nou nod care memorează valoarea x astfel încât informațiile din lista să fie în continuare ordonate crescător.
| Problema | FAdCresc | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64855228 | Utilizator | |
| Fișier | fadcresc.cpp | Dimensiune | 343 B |
| Data încărcării | 07 Iunie 2026, 16:01 | Scor/rezultat | Eroare de compilare |
fadcresc.cpp: In function ‘void ins_cresc(nod*&, int)’: fadcresc.cpp:28:1: error: a function-definition is not allowed here before ‘{’ token 28 | { | ^ fadcresc.cpp:38:1: error: a function-definition is not allowed here before ‘{’ token 38 | { | ^ fadcresc.cpp:45:1: error: a function-definition is not allowed here before ‘{’ token 45 | { | ^ fadcresc.cpp:51:1: error: a function-definition is not allowed here before ‘{’ token 51 | { | ^ fadcresc.cpp:59:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 59 | int main() | ^~ fadcresc.cpp:59:9: note: remove parentheses to default-initialize a variable 59 | int main() | ^~ | -- fadcresc.cpp:59:9: note: or replace parentheses with braces to value-initialize a variable fadcresc.cpp:60:1: error: a function-definition is not allowed here before ‘{’ token 60 | { | ^ fadcresc.cpp:74:2: error: expected ‘}’ at end of input 74 | } | ^ fadcresc.cpp:9:31: note: to match this ‘{’ 9 | void ins_cresc(nod *&p, int x){ | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FAdCresc 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ă.