#4164
FAdaugaInainte
C++
Să se scrie o funcție C++ care inserează înainte de fiecare nod cu informația impară dublul său.
Problema | FAdaugaInainte | Operații I/O |
fadaugainainte.in /fadaugainainte.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 0.2 MB
/
Stivă 0.2 MB
|
Id soluție | #50627769 | Utilizator | |
Fișier | fadaugainainte.cpp | Dimensiune | 2.07 KB |
Data încărcării | 17 Aprilie 2024, 17:46 | Scor / rezultat | Eroare de compilare |
fadaugainainte.cpp:17:8: error: redefinition of 'struct Nod' struct Nod ^ fadaugainainte.cpp:4:8: error: previous definition of 'struct Nod' struct Nod ^ fadaugainainte.cpp: In function 'void FAdaugaInainte(Nod*&)': fadaugainainte.cpp:34:61: error: no matching function for call to 'Nod::Nod(<brace-enclosed initializer list>)' Nod *newNode = new Nod{dublu_informatie, current}; ^ fadaugainainte.cpp:34:61: note: candidates are: fadaugainainte.cpp:8:5: note: Nod::Nod() Nod() ^ fadaugainainte.cpp:8:5: note: candidate expects 0 arguments, 2 provided fadaugainainte.cpp:4:8: note: constexpr Nod::Nod(const Nod&) struct Nod ^ fadaugainainte.cpp:4:8: note: candidate expects 1 argument, 2 provided fadaugainainte.cpp:4:8: note: constexpr Nod::Nod(Nod&&) fadaugainainte.cpp:4:8: note: candidate expects 1 argument, 2 provided fadaugainainte.cpp: In function 'int main()': fadaugainainte.cpp:87:35: error: no matching function for call to 'Nod::Nod(<brace-enclosed initializer list>)' Nod *head = new Nod{1, nullptr}; ^ fadaugainainte.cpp:87:35: note: candidates are: fadaugainainte.cpp:8:5: note: Nod::Nod() Nod() ^ fadaugainainte.cpp:8:5: note: candidate expects 0 arguments, 2 provided fadaugainainte.cpp:4:8: note: constexpr Nod::Nod(const Nod&) struct Nod ^ fadaugainainte.cpp:4:8: note: candidate expects 1 argument, 2 provided fadaugainainte.cpp:4:8: note: constexpr Nod::Nod(Nod&&) fadaugainainte.cpp:4:8: note: candidate expects 1 argument, 2 provided fadaugainainte.cpp:88:35: error: no matching function for call to 'Nod::Nod(<brace-enclosed initializer list>)' head->leg = new Nod{7, nullptr}; ^ fadaugainainte.cpp:88:35: note: candidates are: fadaugainainte.cpp:8:5: note: Nod::Nod() Nod() ^ fadaugainainte.cpp:8:5: note: candidate expects 0 arguments, 2 provided fadaugainainte.cpp:4:8: note: constexpr Nod::Nod(const Nod&) struct Nod ^ fadaugainainte.cpp:4:8: note: candidate expects 1 argument, 2 provided fadaugainainte.cpp:4:8: note: constexpr Nod::Nod(Nod&&) fadaugainainte.cpp:4:8: note: candidate expects 1 argument, 2 provided fadaugainainte.cpp:89:40: error: no matching function for call to 'Nod::Nod(<brace-enclosed initializer list>)' head->leg->leg = new Nod{3, nullptr}; ^ fadaugainainte.cpp:89:40: note: candidates are: fadaugainainte.cpp:8:5: note: Nod::Nod() Nod() ^ fadaugainainte.cpp:8:5: note: candidate expects 0 arguments, 2 provided fadaugainainte.cpp:4:8: note: constexpr Nod::Nod(const Nod&) struct Nod ^ fadaugainainte.cpp:4:8: note: candidate expects 1 argument, 2 provided fadaugainainte.cpp:4:8: note: constexpr Nod::Nod(Nod&&) fadaugainainte.cpp:4:8: note: candidate expects 1 argument, 2 provided fadaugainainte.cpp:90:45: error: no matching function for call to 'Nod::Nod(<brace-enclosed initializer list>)' head->leg->leg->leg = new Nod{4, nullptr}; ^ fadaugainainte.cpp:90:45: note: candidates are: fadaugainainte.cpp:8:5: note: Nod::Nod() Nod() ^ fadaugainainte.cpp:8:5: note: candidate expects 0 arguments, 2 provided fadaugainainte.cpp:4:8: note: constexpr Nod::Nod(const Nod&) struct Nod ^ fadaugainainte.cpp:4:8: note: candidate expects 1 argument, 2 provided fadaugainainte.cpp:4:8: note: constexpr Nod::Nod(Nod&&) fadaugainainte.cpp:4:8: note: candidate expects 1 argument, 2 provided fadaugainainte.cpp:91:51: error: no matching function for call to 'Nod::Nod(<brace-enclosed initializer list>)' head->leg->leg->leg->leg = new Nod{13, nullptr}; ^ fadaugainainte.cpp:91:51: note: candidates are: fadaugainainte.cpp:8:5: note: Nod::Nod() Nod() ^ fadaugainainte.cpp:8:5: note: candidate expects 0 arguments, 2 provided fadaugainainte.cpp:4:8: note: constexpr Nod::Nod(const Nod&) struct Nod ^ fadaugainainte.cpp:4:8: note: candidate expects 1 argument, 2 provided fadaugainainte.cpp:4:8: note: constexpr Nod::Nod(Nod&&) fadaugainainte.cpp:4:8: note: candidate expects 1 argument, 2 provided fadaugainainte.cpp: In function 'int main()': fadaugainainte.cpp:109:5: error: redefinition of 'int main()' int main() ^ fadaugainainte.cpp:84:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FAdaugaInainte 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ă.