#3801
LsiInterclasare
C++
Să se scrie o funcție care interclasează nodurile a două liste.
Folclorul informatic
Problema | LsiInterclasare | Operații I/O |
lsiinterclasare.in /lsiinterclasare.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 16 MB
/
Stivă 8 MB
|
Id soluție | #37917707 | Utilizator | |
Fișier | lsiinterclasare.cpp | Dimensiune | 1.42 KB |
Data încărcării | 24 Septembrie 2022, 18:45 | Scor / rezultat | Eroare de compilare |
lsiinterclasare.cpp:60:8: error: redefinition of 'struct Nod' struct Nod ^ lsiinterclasare.cpp:4:8: error: previous definition of 'struct Nod' struct Nod ^ lsiinterclasare.cpp: In function 'void citire(Nod*)': lsiinterclasare.cpp:69:18: error: no matching function for call to 'Nod::Nod()' Nod *p = new Nod; ^ lsiinterclasare.cpp:69:18: note: candidates are: lsiinterclasare.cpp:8:5: note: Nod::Nod(int, int) Nod(int _id, int x) ^ lsiinterclasare.cpp:8:5: note: candidate expects 2 arguments, 0 provided lsiinterclasare.cpp:4:8: note: constexpr Nod::Nod(const Nod&) struct Nod ^ lsiinterclasare.cpp:4:8: note: candidate expects 1 argument, 0 provided lsiinterclasare.cpp:4:8: note: constexpr Nod::Nod(Nod&&) lsiinterclasare.cpp:4:8: note: candidate expects 1 argument, 0 provided lsiinterclasare.cpp:71:5: error: reference to 'cin' is ambiguous cin>>m; ^ lsiinterclasare.cpp:57:10: note: candidates are: std::ifstream cin ifstream cin("LsiInterclasare.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ lsiinterclasare.cpp:72:5: error: reference to 'cin' is ambiguous cin>>h->info; ^ lsiinterclasare.cpp:57:10: note: candidates are: std::ifstream cin ifstream cin("LsiInterclasare.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ lsiinterclasare.cpp:76:22: error: no matching function for call to 'Nod::Nod()' Nod *a = new Nod; ^ lsiinterclasare.cpp:76:22: note: candidates are: lsiinterclasare.cpp:8:5: note: Nod::Nod(int, int) Nod(int _id, int x) ^ lsiinterclasare.cpp:8:5: note: candidate expects 2 arguments, 0 provided lsiinterclasare.cpp:4:8: note: constexpr Nod::Nod(const Nod&) struct Nod ^ lsiinterclasare.cpp:4:8: note: candidate expects 1 argument, 0 provided lsiinterclasare.cpp:4:8: note: constexpr Nod::Nod(Nod&&) lsiinterclasare.cpp:4:8: note: candidate expects 1 argument, 0 provided lsiinterclasare.cpp:77:9: error: reference to 'cin' is ambiguous cin>>p->info; ^ lsiinterclasare.cpp:57:10: note: candidates are: std::ifstream cin ifstream cin("LsiInterclasare.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ lsiinterclasare.cpp: In function 'void afisare(Nod*)': lsiinterclasare.cpp:87:9: error: reference to 'cout' is ambiguous cout<<h->info<<" "; ^ lsiinterclasare.cpp:58:10: note: candidates are: std::ofstream cout ofstream cout("LsiInterclasare.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ lsiinterclasare.cpp: In function 'int main()': lsiinterclasare.cpp:137:17: error: no matching function for call to 'Nod::Nod()' Nod *h1=new Nod, *h2= new Nod, *h=new Nod; ^ lsiinterclasare.cpp:137:17: note: candidates are: lsiinterclasare.cpp:8:5: note: Nod::Nod(int, int) Nod(int _id, int x) ^ lsiinterclasare.cpp:8:5: note: candidate expects 2 arguments, 0 provided lsiinterclasare.cpp:4:8: note: constexpr Nod::Nod(const Nod&) struct Nod ^ lsiinterclasare.cpp:4:8: note: candidate expects 1 argument, 0 provided lsiinterclasare.cpp:4:8: note: constexpr Nod::Nod(Nod&&) lsiinterclasare.cpp:4:8: note: candidate expects 1 argument, 0 provided lsiinterclasare.cpp: In function 'int main()': lsiinterclasare.cpp:151:5: error: redefinition of 'int main()' int main() ^ lsiinterclasare.cpp:135:5: error: 'int main()' previously defined here int main() ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema LsiInterclasare 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ă.