#4684
Să se scrie o funcție care șterge fiecare al treilea nod dintr-o listă simplu înlănțuită.
| Problema | FLsiThird | Operații I/O |
flsithird.in/flsithird.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64087738 | Utilizator | |
| Fișier | flsithird.cpp | Dimensiune | 837 B |
| Data încărcării | 16 Aprilie 2026, 11:46 | Scor/rezultat | Eroare de compilare |
flsithird.cpp:62:13: warning: missing terminating ' character 62 | p->urm=r' | ^ flsithird.cpp:62:13: error: missing terminating ' character flsithird.cpp:21:8: error: redefinition of ‘struct nod’ 21 | struct nod | ^~~ flsithird.cpp:4:8: note: previous definition of ‘struct nod’ 4 | struct nod | ^~~ flsithird.cpp: In function ‘void EraseThird(nod*)’: flsithird.cpp:32:14: error: no matching function for call to ‘nod::nod()’ 32 | prim=new nod; | ^~~ flsithird.cpp:8:5: note: candidate: ‘nod::nod(int)’ 8 | nod(int x) | ^~~ flsithird.cpp:8:5: note: candidate expects 1 argument, 0 provided flsithird.cpp:4:8: note: candidate: ‘constexpr nod::nod(const nod&)’ 4 | struct nod | ^~~ flsithird.cpp:4:8: note: candidate expects 1 argument, 0 provided flsithird.cpp:4:8: note: candidate: ‘constexpr nod::nod(nod&&)’ flsithird.cpp:4:8: note: candidate expects 1 argument, 0 provided flsithird.cpp:38:16: error: no matching function for call to ‘nod::nod()’ 38 | nou=new nod; | ^~~ flsithird.cpp:8:5: note: candidate: ‘nod::nod(int)’ 8 | nod(int x) | ^~~ flsithird.cpp:8:5: note: candidate expects 1 argument, 0 provided flsithird.cpp:4:8: note: candidate: ‘constexpr nod::nod(const nod&)’ 4 | struct nod | ^~~ flsithird.cpp:4:8: note: candidate expects 1 argument, 0 provided flsithird.cpp:4:8: note: candidate: ‘constexpr nod::nod(nod&&)’ flsithird.cpp:4:8: note: candidate expects 1 argument, 0 provided flsithird.cpp:44:12: error: return-statement with a value, in function returning ‘void’ [-fpermissive] 44 | return prim; | ^~~~ flsithird.cpp: At global scope: flsithird.cpp:47:6: error: redefinition of ‘void EraseThird(nod*)’ 47 | void EraseThird(nod *head) | ^~~~~~~~~~ flsithird.cpp:26:6: note: ‘void EraseThird(nod*)’ previously defined here 26 | void EraseThird(nod *head) | ^~~~~~~~~~ flsithird.cpp: In function ‘void EraseThird(nod*)’: flsithird.cpp:54:7: error: ‘urm’ was not declared in this scope 54 | p=urm=r; | ^~~ flsithird.cpp:58:13: warning: statement has no effect [-Wunused-value] 58 | p->urm->urm; | ~~~~~~~~^~~ flsithird.cpp:62:13: error: expected ‘;’ before ‘}’ token 62 | p->urm=r' | ^ | ; 63 | } | ~ flsithird.cpp: In function ‘int main()’: flsithird.cpp:72:6: error: ‘creare’ was not declared in this scope 72 | p=creare; | ^~~~~~ flsithird.cpp:73:15: error: cannot convert ‘int*’ to ‘nod*’ 73 | EraseThird(p); | ^ | | | int* flsithird.cpp:26:22: note: initializing argument 1 of ‘void EraseThird(nod*)’ 26 | void EraseThird(nod *head) | ~~~~~^~~~ flsithird.cpp:76:14: error: request for member ‘info’ in ‘* p’, which is of non-class type ‘int’ 76 | cout<<p->info; | ^~~~ flsithird.cpp:77:10: error: request for member ‘urm’ in ‘* p’, which is of non-class type ‘int’ 77 | p=p->urm; | ^~~ flsithird.cpp: At global scope: flsithird.cpp:83:5: error: redefinition of ‘int main()’ 83 | int main() | ^~~~ flsithird.cpp:70:5: note: ‘int main()’ previously defined here 70 | int main() | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FLsiThird 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ă.