#1182
Să se scrie o funcție C++ care inserează înaintea fiecărui element par al unei liste simplu înlănțuită dublul său.
| Problema | FListaInserare3 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64845132 | Utilizator | |
| Fișier | flistainserare3.cpp | Dimensiune | 424 B |
| Data încărcării | 06 Iunie 2026, 12:28 | Scor/rezultat | Eroare de compilare |
flistainserare3.cpp: In function ‘void inserare(nod*&)’: flistainserare3.cpp:39:13: error: conversion from ‘nod*’ to non-scalar type ‘nod’ requested 39 | nod q = p; | ^ flistainserare3.cpp:42:17: error: conversion from ‘nod*’ to non-scalar type ‘nod’ requested 42 | nod r = new nod; | ^~~~~~~ flistainserare3.cpp:43:10: error: base operand of ‘->’ has non-pointer type ‘nod’ 43 | r->urm=p; | ^~ flistainserare3.cpp:44:10: error: base operand of ‘->’ has non-pointer type ‘nod’ 44 | r->info=2*p->info; | ^~ flistainserare3.cpp:45:11: error: cannot convert ‘nod’ to ‘nod*’ in assignment 45 | p=r; | ^ | | | nod flistainserare3.cpp:47:12: error: base operand of ‘->’ has non-pointer type ‘nod’ 47 | while(q->urm) | ^~ flistainserare3.cpp:49:13: error: base operand of ‘->’ has non-pointer type ‘nod’ 49 | if(q->urm->info%2==0) | ^~ flistainserare3.cpp:51:13: error: ‘r’ was not declared in this scope 51 | r= new nod; | ^ flistainserare3.cpp:52:24: error: base operand of ‘->’ has non-pointer type ‘nod’ 52 | r->info=2*q->urm->info; | ^~ flistainserare3.cpp:53:21: error: base operand of ‘->’ has non-pointer type ‘nod’ 53 | r->urm=q->urm; | ^~ flistainserare3.cpp:54:14: error: base operand of ‘->’ has non-pointer type ‘nod’ 54 | q->urm=r; | ^~ flistainserare3.cpp:56:16: error: base operand of ‘->’ has non-pointer type ‘nod’ 56 | q=q->urm; | ^~ flistainserare3.cpp:58:12: error: base operand of ‘->’ has non-pointer type ‘nod’ 58 | q=q->urm; | ^~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FListaInserare3 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ă.