#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 | #30668885 | Utilizator | |
Fișier | lsiinterclasare.cpp | Dimensiune | 752 B |
Data încărcării | 07 Septembrie 2021, 15:40 | Scor / rezultat | Eroare de compilare |
lsiinterclasare.cpp:53:39: error: expected ',' or '...' before 'Nod' void LsiInterclasare(Nod* h1, Nod* h2 Nod*& h){ ^ lsiinterclasare.cpp: In function 'void LsiInterclasare(Nod*, Nod*)': lsiinterclasare.cpp:54:45: error: conversion from 'Nod*' to non-scalar type 'Nod' requested Nod* h1Actual = &(h1[0]), h2Actual = &(h2[0]); ^ lsiinterclasare.cpp:57:20: error: no match for 'operator||' (operand types are 'Nod*' and 'Nod') while(h1Actual || h2Actual){ ^ lsiinterclasare.cpp:57:20: note: candidates are: lsiinterclasare.cpp:57:20: note: operator||(bool, bool) <built-in> lsiinterclasare.cpp:57:20: note: no known conversion for argument 2 from 'Nod' to 'bool' In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:413:5: note: template<class _Dom1, class _Dom2> std::_Expr<std::_BinClos<std::__logical_or, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__logical_or, typename _Dom1::value_type>::result_type> std::operator||(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(||, __logical_or) ^ /usr/include/c++/4.8/bits/valarray_after.h:413:5: note: template argument deduction/substitution failed: lsiinterclasare.cpp:57:23: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'Nod*' while(h1Actual || h2Actual){ ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:413:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__logical_or, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_or, typename _Dom1::value_type>::result_type> std::operator||(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&) _DEFINE_EXPR_BINARY_OPERATOR(||, __logical_or) ^ /usr/include/c++/4.8/bits/valarray_after.h:413:5: note: template argument deduction/substitution failed: lsiinterclasare.cpp:57:23: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'Nod*' while(h1Actual || h2Actual){ ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:413:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__logical_or, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_or, typename _Dom1::value_type>::result_type> std::operator||(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(||, __logical_or) ^ /usr/include/c++/4.8/bits/valarray_after.h:413:5: note: template argument deduction/substitution failed: lsiinterclasare.cpp:57:23: note: 'Nod' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' while(h1Actual || h2Actual){ ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:413:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__logical_or, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_or, typename _Dom1::value_type>::result_type> std::operator||(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _Dom::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(||, __logical_or) ^ /usr/include/c++/4.8/bits/valarray_after.h:413:5: note: template argument deduction/substitution failed: lsiinterclasare.cpp:57:23: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'Nod*' while(h1Actual || h2Actual){ ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:413:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__logical_or, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_or, typename _Dom1::value_type>::result_type> std::operator||(const std::valarray<typename _Dom::value_type>&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(||, __logical_or) ^ /usr/include/c++/4.8/bits/valarray_after.h:413:5: note: template argument deduction/substitution failed: lsiinterclasare.cpp:57:23: note: mismatched types 'const std::valarray<typename _Dom::value_type>' and 'Nod*' while(h1Actual || h2Actual){ ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/valarray:1178:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__logical_or, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__logical_or, _Tp>::result_type> std::operator||(const std::valarray<_Tp>&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(||, __logical_or) ^ /usr/include/c++/4.8/valarray:1178:1: note: template argument deduction/substitution failed: lsiinterclasare.cpp:57:23: note: mismatched types 'const std::valarray<_Tp>' and 'Nod*' while(h1Actual || h2Actual){ ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/valarray:1178:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__logical_or, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__logical_or, _Tp>::result_type> std::operator||(const std::valarray<_Tp>&, const _Tp&) _DEFINE_BINARY_OPERATOR(||, __logical_or) ^ /usr/include/c++/4.8/valarray:1178:1: note: template argument deduction/substitution failed: lsiinterclasare.cpp:57:23: note: mismatched types 'const std::valarray<_Tp>' and 'Nod*' while(h1Actual || h2Actual){ ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0, from lsiinterclasare.cpp:1: /usr/include/c++/4.8/valarray:1178:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__logical_or, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__logical_or, _Tp>::result_type> std::operator||(const _Tp&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(||, __logical_or) ^ /usr/include/c++/4.8/valarray:1178:1: note: template argument deduction/substitution failed: lsiinterclasare.cpp:57:23: note: 'Nod' is not derived from 'const std::valarray<_Tp>' while(h1Actual || h2Actual){ ^ lsiinterclasare.cpp:60:35: error: cannot convert 'Nod' to 'Nod*' in assignment h[hIndex - 1].leg = h2Actual ^ lsiinterclasare.cpp:61:10: error: expected ';' before 'h' h[hIndex] = h2Actual; ^ lsiinterclasare.cpp:62:19: error: no match for 'operator!' (operand type is 'Nod') } else if(!h2Actual) { ^ lsiinterclasare.cpp:62:19: note: candidate is: lsiinterclasare.cpp:62:19: note: operator!(bool) <built-in> lsiinterclasare.cpp:62:19: note: no known conversion for argument 1 from 'Nod' to 'bool' lsiinterclasare.cpp:65:10: error: expected ';' before 'h' h[hIndex] = h1Actual; ^ lsiinterclasare.cpp:66:29: error: request for member 'info' in 'h1Actual', which is of pointer type 'Nod*' (maybe you meant to use '->' ?) } else if(h1Actual.info > h2Actual.info){ ^ lsiinterclasare.cpp:68:35: error: cannot convert 'Nod' to 'Nod*' in assignment h[hIndex - 1].leg = h2Actual ^ lsiinterclasare.cpp:69:10: error: expected ';' before 'h' h[hIndex] = h2Actual; ^ lsiinterclasare.cpp:73:10: error: expected ';' before 'h' h[hIndex] = h1Actual; ^ lsiinterclasare.cpp: In function 'int main()': lsiinterclasare.cpp:83:30: error: too many arguments to function 'void LsiInterclasare(Nod*, Nod*)' LsiInterclasare(h1, h2, h); ^ lsiinterclasare.cpp:53:6: note: declared here void LsiInterclasare(Nod* h1, Nod* h2 Nod*& h){ ^
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ă.