#3789
FListaOglindire
C++
Să se scrie o funcție C++ care oglindește nodurile unei liste simplu înlănțuite alocate dinamic.
Problema | FListaOglindire | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51267892 | Utilizator | |
Fișier | flistaoglindire.cpp | Dimensiune | 383 B |
Data încărcării | 03 Iunie 2024, 11:44 | Scor / rezultat | Eroare de compilare |
flistaoglindire.cpp: In function 'void oglindire(nod*&)': flistaoglindire.cpp:53:20: error: conversion from 'int' to non-scalar type 'nod' requested nod *aux=p,cnt=0; ^ flistaoglindire.cpp:55:25: error: no 'operator++(int)' declared for postfix '++' [-fpermissive] aux=aux->urm,cnt++; ^ flistaoglindire.cpp:56:14: error: cannot convert 'nod' to 'int' in initialization int cnt2=cnt; ^ flistaoglindire.cpp:57:14: error: no 'operator--(int)' declared for postfix '--' [-fpermissive] while(cnt--) ^ flistaoglindire.cpp:60:20: error: no match for 'operator-' (operand types are 'int' and 'nod') int nr=cnt2-cnt; ^ flistaoglindire.cpp:60:20: note: candidates are: In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from flistaoglindire.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:327:5: note: template<class _Iterator> typename std::reverse_iterator<_Iterator>::difference_type std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&) operator-(const reverse_iterator<_Iterator>& __x, ^ /usr/include/c++/4.8/bits/stl_iterator.h:327:5: note: template argument deduction/substitution failed: flistaoglindire.cpp:60:21: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' int nr=cnt2-cnt; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from flistaoglindire.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:379:5: note: template<class _IteratorL, class _IteratorR> decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&) operator-(const reverse_iterator<_IteratorL>& __x, ^ /usr/include/c++/4.8/bits/stl_iterator.h:379:5: note: template argument deduction/substitution failed: flistaoglindire.cpp:60:21: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' int nr=cnt2-cnt; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from flistaoglindire.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:1104:5: note: template<class _IteratorL, class _IteratorR> decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_Iterator>&, const std::move_iterator<_IteratorR>&) operator-(const move_iterator<_IteratorL>& __x, ^ /usr/include/c++/4.8/bits/stl_iterator.h:1104:5: note: template argument deduction/substitution failed: flistaoglindire.cpp:60:21: note: mismatched types 'const std::move_iterator<_Iterator>' and 'int' int nr=cnt2-cnt; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from flistaoglindire.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h:1111:5: note: template<class _Iterator> decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_Iterator>&, const std::move_iterator<_Iterator>&) operator-(const move_iterator<_Iterator>& __x, ^ /usr/include/c++/4.8/bits/stl_iterator.h:1111:5: note: template argument deduction/substitution failed: flistaoglindire.cpp:60:21: note: mismatched types 'const std::move_iterator<_Iterator>' and 'int' int nr=cnt2-cnt; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FListaOglindire 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ă.