#4167
FLsiElimina
C++
Să se scrie o funcție C++ care elimină toate nodurile cuprinse între cel mai din stânga nod care memorează un număr divizibil cu 3
și cel mai din dreapta nod care memorează un număr divizibil cu 3
, inclusiv acestea.
Problema | FLsiElimina | Operații I/O |
![]() flsielimina.in /flsielimina.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 1 MB
/
Stivă 1 MB
|
Id soluție | #43700054 | Utilizator | |
Fișier | flsielimina.cpp | Dimensiune | 863 B |
Data încărcării | 10 Mai 2023, 19:05 | Scor / rezultat | Eroare de compilare |
flsielimina.cpp: In function 'void FLsiElimina(Nod*&)': flsielimina.cpp:12:9: error: 'p' was not declared in this scope for(p=head;p!=NULL;p=p->leg) ^ flsielimina.cpp:14:10: error: 'cnt' was not declared in this scope cnt++; ^ flsielimina.cpp:15:29: error: 'sw' was not declared in this scope if(p->info%3==0 && sw==0) ^ flsielimina.cpp:17:14: error: 'aux1' was not declared in this scope aux1=cnt; ^ flsielimina.cpp:20:27: error: 'aux2' was not declared in this scope if(p->info%3==0) aux2=cnt; ^ flsielimina.cpp:23:6: error: 'cnt' was not declared in this scope cnt=0; ^ flsielimina.cpp:24:10: error: 'p' was not declared in this scope for(p=head;p!=NULL;p=p->leg) ^ flsielimina.cpp:27:18: error: 'aux1' was not declared in this scope if(cnt>=aux1 && cnt<=aux2) ^ flsielimina.cpp:27:31: error: 'aux2' was not declared in this scope if(cnt>=aux1 && cnt<=aux2) ^ flsielimina.cpp:32:20: error: type '<type error>' argument given to 'delete', expected pointer delete p; ^ flsielimina.cpp:34:20: error: 'ultim' was not declared in this scope else if(p==ultim) ^ flsielimina.cpp:36:13: error: 'nod' was not declared in this scope nod *q=head; ^ flsielimina.cpp:36:18: error: 'q' was not declared in this scope nod *q=head; ^ flsielimina.cpp:40:20: error: type '<type error>' argument given to 'delete', expected pointer delete ultim; ^ flsielimina.cpp:45:11: error: 'nod' was not declared in this scope nod *q=head; ^ flsielimina.cpp:45:16: error: 'q' was not declared in this scope nod *q=head; ^ flsielimina.cpp:49:18: error: type '<type error>' argument given to 'delete', expected pointer delete p; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FLsiElimina 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ă.