#70
FMultiplu
C++
Scrieți definiția completă a subprogramului multipli
, cu trei parametri a
, b
, c
(a≤b
), numere naturale, ce returnează numărul multiplilor lui c
din intervalul [a;b]
.
Problema | FMultiplu | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53869428 | Utilizator | |
Fișier | fmultiplu.cpp | Dimensiune | 95 B |
Data încărcării | 13 Noiembrie 2024, 16:59 | Scor / rezultat | Eroare de compilare |
fmultiplu.cpp: In function 'int multipli(int, int, int)': fmultiplu.cpp:7:10: error: expected ',' before '/' token nr=[b/c]-[(a-1)/c]; ^ fmultiplu.cpp:7:10: error: expected identifier before '/' token fmultiplu.cpp: In lambda function: fmultiplu.cpp:7:13: error: expected '{' before '-' token nr=[b/c]-[(a-1)/c]; ^ fmultiplu.cpp: In function 'int multipli(int, int, int)': fmultiplu.cpp:7:15: error: expected identifier before '(' token nr=[b/c]-[(a-1)/c]; ^ fmultiplu.cpp: In lambda function: fmultiplu.cpp:7:23: error: expected '{' before ';' token nr=[b/c]-[(a-1)/c]; ^ fmultiplu.cpp: In function 'int multipli(int, int, int)': fmultiplu.cpp:7:13: error: no match for 'operator-' (operand types are 'multipli(int, int, int)::__lambda0' and 'multipli(int, int, int)::__lambda1') nr=[b/c]-[(a-1)/c]; ^ fmultiplu.cpp:7:13: 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 fmultiplu.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: fmultiplu.cpp:7:23: note: 'multipli(int, int, int)::__lambda0' is not derived from 'const std::reverse_iterator<_Iterator>' nr=[b/c]-[(a-1)/c]; ^ 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 fmultiplu.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: fmultiplu.cpp:7:23: note: 'multipli(int, int, int)::__lambda0' is not derived from 'const std::reverse_iterator<_Iterator>' nr=[b/c]-[(a-1)/c]; ^ 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 fmultiplu.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: fmultiplu.cpp:7:23: note: 'multipli(int, int, int)::__lambda0' is not derived from 'const std::move_iterator<_Iterator>' nr=[b/c]-[(a-1)/c]; ^ 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 fmultiplu.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: fmultiplu.cpp:7:23: note: 'multipli(int, int, int)::__lambda0' is not derived from 'const std::move_iterator<_Iterator>' nr=[b/c]-[(a-1)/c]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FMultiplu 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ă.