#4176
Să se scrie o funcție C++ care inserează după nodul care memorează informația minimă un nou nod care va reține valoarea x
| Problema | FLdiAdDupa | Operații I/O |
fldiaddupa.in/fldiaddupa.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64870800 | Utilizator | |
| Fișier | fldiaddupa.cpp | Dimensiune | 329 B |
| Data încărcării | 08 Iunie 2026, 18:06 | Scor/rezultat | Eroare de compilare |
fldiaddupa.cpp: In function ‘void FLdiAdDupa(nod*&, nod*&, int)’: fldiaddupa.cpp:17:14: error: conversion from ‘nod*’ to non-scalar type ‘nod’ requested 17 | nod *p,q=new nod;q=prim; | ^~~~~~~ fldiaddupa.cpp:17:24: error: no match for ‘operator=’ (operand types are ‘nod’ and ‘nod*’) 17 | nod *p,q=new nod;q=prim; | ^~~~ fldiaddupa.cpp:4:8: note: candidate: ‘nod& nod::operator=(const nod&)’ 4 | struct nod | ^~~ fldiaddupa.cpp:4:8: note: no known conversion for argument 1 from ‘nod*’ to ‘const nod&’ fldiaddupa.cpp:4:8: note: candidate: ‘nod& nod::operator=(nod&&)’ fldiaddupa.cpp:4:8: note: no known conversion for argument 1 from ‘nod*’ to ‘nod&&’ fldiaddupa.cpp:18:13: warning: overflow in conversion from ‘double’ to ‘int’ changes value from ‘1.0e+10’ to ‘2147483647’ [-Woverflow] 18 | p->info=10e9; | ^~~~ fldiaddupa.cpp:19:11: error: could not convert ‘q’ from ‘nod’ to ‘bool’ 19 | while(q) | ^ | | | nod fldiaddupa.cpp:21:21: error: base operand of ‘->’ has non-pointer type ‘nod’ 21 | if(p->info>q->info) | ^~ fldiaddupa.cpp:23:15: error: cannot convert ‘nod’ to ‘nod*’ in assignment 23 | p=q; | ^ | | | nod fldiaddupa.cpp:24:22: error: base operand of ‘->’ has non-pointer type ‘nod’ 24 | p->info=q->info; | ^~ fldiaddupa.cpp:26:12: error: base operand of ‘->’ has non-pointer type ‘nod’ 26 | q=q->urm; | ^~ fldiaddupa.cpp:28:13: error: conversion from ‘nod*’ to non-scalar type ‘nod’ requested 28 | nod ins=new nod; | ^~~~~~~ fldiaddupa.cpp:29:8: error: base operand of ‘->’ has non-pointer type ‘nod’ 29 | ins->ant=p; | ^~ fldiaddupa.cpp:30:8: error: base operand of ‘->’ has non-pointer type ‘nod’ 30 | ins->urm=p->urm; | ^~ fldiaddupa.cpp:31:8: error: base operand of ‘->’ has non-pointer type ‘nod’ 31 | ins->info=x; | ^~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FLdiAdDupa 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ă.