Detalii evaluare #64502349

Rezumat problemă

Să se scrie o funcție C++ cu următorul prototip:
void AdaugareFinal(nod * & prim , nod * & ultim, int x);

care adaugă valoarea x la sfârșitul listei pentru care primul element are adresa memorată în pointerul prim si ultimul element are adresa memorata in pointerul ultim .

Detalii

Problema FAdaugareFinalLLDI Operații I/O fadaugarefinal.in/fadaugarefinal.out
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #64502349 Utilizator Radulescu Marian-Daniel (radulescumariandaniel)
Fișier fadaugarefinallldi.cpp Dimensiune 1006 B
Data încărcării 11 Mai 2026, 14:50 Scor/rezultat Eroare de compilare

Evaluare

Mesaj compilare

fadaugarefinallldi.cpp:36:8: error: redefinition of ‘struct nod’
   36 | struct nod{
      |        ^~~
fadaugarefinallldi.cpp:7:8: note: previous definition of ‘struct nod’
    7 | struct nod
      |        ^~~
fadaugarefinallldi.cpp: In function ‘void AdaugareFinal(nod*&, nod*&, int)’:
fadaugarefinallldi.cpp:52:9: error: ‘q’ was not declared in this scope
   52 |         q = new nod;
      |         ^
fadaugarefinallldi.cpp:55:20: error: ‘utl’ was not declared in this scope
   55 |         q -> ant = utl;
      |                    ^~~
fadaugarefinallldi.cpp: At global scope:
fadaugarefinallldi.cpp:60:5: error: redefinition of ‘int main()’
   60 | int main()
      |     ^~~~
fadaugarefinallldi.cpp:17:5: note: ‘int main()’ previously defined here
   17 | int main()
      |     ^~~~
fadaugarefinallldi.cpp: In function ‘int main()’:
fadaugarefinallldi.cpp:63:9: error: ‘i’ was not declared in this scope
   63 |     for(i = 1; i <=3; i++)
      |         ^
fadaugarefinallldi.cpp:64:16: error: ‘a’ was not declared in this scope
   64 |         cin >> a[i];
      |                ^
fadaugarefinallldi.cpp:65:12: error: no matching function for call to ‘get()’
   65 |     cin,get();
      |         ~~~^~
In file included from /usr/include/c++/13/bits/stl_algobase.h:64,
                 from /usr/include/c++/13/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from fadaugarefinallldi.cpp:1:
/usr/include/c++/13/bits/stl_pair.h:1035:5: note: candidate: ‘template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(pair<_Tp1, _Tp2>&)’
 1035 |     get(pair<_Tp1, _Tp2>& __in) noexcept
      |     ^~~
/usr/include/c++/13/bits/stl_pair.h:1035:5: note:   template argument deduction/substitution failed:
fadaugarefinallldi.cpp:65:12: note:   candidate expects 1 argument, 0 provided
   65 |     cin,get();
      |         ~~~^~
/usr/include/c++/13/bits/stl_pair.h:1040:5: note: candidate: ‘template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(pair<_Tp1, _Tp2>&&)’
 1040 |     get(pair<_Tp1, _Tp2>&& __in) noexcept
      |     ^~~
/usr/include/c++/13/bits/stl_pair.h:1040:5: note:   template argument deduction/substitution failed:
fadaugarefinallldi.cpp:65:12: note:   candidate expects 1 argument, 0 provided
   65 |     cin,get();
      |         ~~~^~
/usr/include/c++/13/bits/stl_pair.h:1045:5: note: candidate: ‘template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(const pair<_Tp1, _Tp2>&)’
 1045 |     get(const pair<_Tp1, _Tp2>& __in) noexcept
      |     ^~~
/usr/include/c++/13/bits/stl_pair.h:1045:5: note:   template argument deduction/substitution failed:
fadaugarefinallldi.cpp:65:12: note:   candidate expects 1 argument, 0 provided
   65 |     cin,get();
      |         ~~~^~
/usr/include/c++/13/bits/stl_pair.h:1050:5: note: candidate: ‘template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(const pair<_Tp1, _Tp2>&&)’
 1050 |     get(const pair<_Tp1, _Tp2>&& __in) noexcept
      |     ^~~
/usr/include/c++/13/bits/stl_pair.h:1050:5: note:   template argument deduction/substitution failed:
fadaugarefinallldi.cpp:65:12: note:   candidate expects 1 argument, 0 provided
   65 |     cin,get();
      |         ~~~^~
In file included from /usr/include/c++/13/functional:53,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53:
/usr/include/c++/13/tuple:1803:5: note: candidate: ‘template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Types ...> >& std::get(tuple<_Types ...>&)’
 1803 |     get(tuple<_Elements...>& __t) noexcept
      |     ^~~
/usr/include/c++/13/tuple:1803:5: note:   template argument deduction/substitution failed:
fadaugarefinallldi.cpp:65:12: note:   candidate expects 1 argument, 0 provided
   65 |     cin,get();
      |         ~~~^~
/usr/include/c++/13/tuple:1809:5: note: candidate: ‘template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Types ...> >& std::get(const tuple<_Types ...>&)’
 1809 |     get(const tuple<_Elements...>& __t) noexcept
      |     ^~~
/usr/include/c++/13/tuple:1809:5: note:   template argument deduction/substitution failed:
fadaugarefinallldi.cpp:65:12: note:   candidate expects 1 argument, 0 provided
   65 |     cin,get();
      |         ~~~^~
/usr/include/c++/13/tuple:1815:5: note: candidate: ‘template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Types ...> >&& std::get(tuple<_Types ...>&&)’
 1815 |     get(tuple<_Elements...>&& __t) noexcept
      |     ^~~
/usr/include/c++/13/tuple:1815:5: note:   template argument deduction/substitution failed:
fadaugarefinallldi.cpp:65:12: note:   candidate expects 1 argument, 0 provided
   65 |     cin,get();
      |         ~~~^~
/usr/include/c++/13/tuple:1824:5: note: candidate: ‘template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Types ...> >&& std::get(const tuple<_Types ...>&&)’
 1824 |     get(const tuple<_Elements...>&& __t) noexcept
      |     ^~~
/usr/include/c++/13/tuple:1824:5: note:   template argument deduction/substitution failed:
fadaugarefinallldi.cpp:65:12: note:   candidate expects 1 argument, 0 provided
   65 |     cin,get();
      |         ~~~^~
/usr/include/c++/13/tuple:1834:5: note: candidate: ‘template<long unsigned int __i, class ... _Elements> constexpr std::__enable_if_t<(__i >= sizeof... (_Types))> std::get(const tuple<_Types ...>&)’ (deleted)
 1834 |     get(const tuple<_Elements...>&) = delete;
      |     ^~~
/usr/include/c++/13/tuple:1834:5: note:   template argument deduction/substitution failed:
fadaugarefinallldi.cpp:65:12: note:   candidate expects 1 argument, 0 provided
   65 |     cin,get();
      |         ~~~^~
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:63:
/usr/include/c++/13/array:384:5: note: candidate: ‘template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp& std::get(array<_Tp, _Nm>&)’
  384 |     get(array<_Tp, _Nm>& __arr) noexcept
      |     ^~~
/usr/include/c++/13/array:384:5: note:   template argument deduction/substitution failed:
fadaugarefinallldi.cpp:65:12: note:   candidate expects 1 argument, 0 provided
   65 |     cin,get();
      |         ~~~^~
/usr/include/c++/13/array:393:5: note: candidate: ‘template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp&& std::get(array<_Tp, _Nm>&&)’
  393 |     get(array<_Tp, _Nm>&& __arr) noexcept
      |     ^~~
/usr/include/c++/13/array:393:5: note:   template argument deduction/substitution failed:
fadaugarefinallldi.cpp:65:12: note:   candidate expects 1 argument, 0 provided
   65 |     cin,get();
      |         ~~~^~
/usr/include/c++/13/array:402:5: note: candidate: ‘template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp& std::get(const array<_Tp, _Nm>&)’
  402 |     get(const array<_Tp, _Nm>& __arr) noexcept
      |     ^~~
/usr/include/c++/13/array:402:5: note:   template argument deduction/substitution failed:
fadaugarefinallldi.cpp:65:12: note:   candidate expects 1 argument, 0 provided
   65 |     cin,get();
      |         ~~~^~
/usr/include/c++/13/array:411:5: note: candidate: ‘template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp&& std::get(const array<_Tp, _Nm>&&)’
  411 |     get(const array<_Tp, _Nm>&& __arr) noexcept
      |     ^~~
/usr/include/c++/13/array:411:5: note:   template argument deduction/substitution failed:
fadaugarefinallldi.cpp:65:12: note:   candidate expects 1 argument, 0 provided
   65 |     cin,get();
      |         ~~~^~
fadaugarefinallldi.cpp:66:14: error: ‘S’ was not declared in this scope
   66 |     cin. get(S, 101);
      |              ^
fadaugarefinallldi.cpp:67:5: error: ‘k’ was not declared in this scope
   67 |     k = 1;
      |     ^
fadaugarefinallldi.cpp:68:5: error: ‘j’ was not declared in this scope; did you mean ‘jn’?
   68 |     j = 0;
      |     ^
      |     jn
fadaugarefinallldi.cpp:75:24: error: ‘a’ was not declared in this scope
   75 |             if((S[i] + a[k++]) > 'Z')
      |                        ^
fadaugarefinallldi.cpp:77:17: error: ‘x’ was not declared in this scope
   77 |                 x = (S[i] + a[k]) - ('Z' - 'A' +1);
      |                 ^
fadaugarefinallldi.cpp:78:17: error: ‘b’ was not declared in this scope
   78 |                 b[j++] = 'A' + x;
      |                 ^
fadaugarefinallldi.cpp:81:17: error: ‘b’ was not declared in this scope
   81 |                 b[j++] = S [i] + a[k++];
      |                 ^
fadaugarefinallldi.cpp:84:5: error: ‘b’ was not declared in this scope
   84 |     b[j] = '\0';
      |     ^

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema FAdaugareFinalLLDI 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:

  • Soluția propusă de tine este inclusă în programul suport, apoi acesta este compilat. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Datorită existenței programului suport, la compilare pot să apară erori sau avertismente care să nu se refere la instrucțiunile scrise de tine, dar care sunt datorate faptului că soluția ta nu este corectă.
  • Dacă programul suport a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.

Du-te sus!