#816
Determinați câte sticle de x litri cu apă trebuie deschise pentru a umple un vas de y litri.
| Problema | Sticle | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64664762 | Utilizator | |
| Fișier | sticle.cpp | Dimensiune | 184 B |
| Data încărcării | 21 Mai 2026, 11:30 | Scor/rezultat | Eroare de compilare |
sticle.cpp: In function ‘int main()’: sticle.cpp:8:11: error: no match for ‘operator>’ (operand types are ‘std::basic_istream<char>::__istream_type’ {aka ‘std::basic_istream<char>’} and ‘int’) 8 | cin>>x>y; | ~~~~~~^~ | | | | | int | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} sticle.cpp:8:11: note: candidate: ‘operator>(int, int)’ (built-in) 8 | cin>>x>y; | ~~~~~~^~ sticle.cpp:8:11: note: no known conversion for argument 1 from ‘std::basic_istream<char>::__istream_type’ {aka ‘std::basic_istream<char>’} to ‘int’ In file included from /usr/include/c++/13/string:48, from /usr/include/c++/13/bits/locale_classes.h:40, from /usr/include/c++/13/bits/ios_base.h:41, from /usr/include/c++/13/ios:44, from /usr/include/c++/13/ostream:40, from /usr/include/c++/13/iostream:41, from sticle.cpp:1: /usr/include/c++/13/bits/stl_iterator.h:469:5: note: candidate: ‘template<class _Iterator> bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)’ 469 | operator>(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:469:5: note: template argument deduction/substitution failed: sticle.cpp:8:12: note: ‘std::basic_istream<char>::__istream_type’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::reverse_iterator<_Iterator>’ 8 | cin>>x>y; | ^ /usr/include/c++/13/bits/stl_iterator.h:514:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)’ 514 | operator>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:514:5: note: template argument deduction/substitution failed: sticle.cpp:8:12: note: ‘std::basic_istream<char>::__istream_type’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::reverse_iterator<_Iterator>’ 8 | cin>>x>y; | ^ /usr/include/c++/13/bits/stl_iterator.h:1725:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)’ 1725 | operator>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:1725:5: note: template argument deduction/substitution failed: sticle.cpp:8:12: note: ‘std::basic_istream<char>::__istream_type’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::move_iterator<_IteratorL>’ 8 | cin>>x>y; | ^ /usr/include/c++/13/bits/stl_iterator.h:1784:5: note: candidate: ‘template<class _Iterator> bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)’ 1784 | operator>(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/13/bits/stl_iterator.h:1784:5: note: template argument deduction/substitution failed: sticle.cpp:8:12: note: ‘std::basic_istream<char>::__istream_type’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::move_iterator<_IteratorL>’ 8 | cin>>x>y; | ^ In file included from /usr/include/c++/13/bits/stl_algobase.h:64, from /usr/include/c++/13/string:51: /usr/include/c++/13/bits/stl_pair.h:848:5: note: candidate: ‘template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)’ 848 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/13/bits/stl_pair.h:848:5: note: template argument deduction/substitution failed: sticle.cpp:8:12: note: ‘std::basic_istream<char>::__istream_type’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::pair<_T1, _T2>’ 8 | cin>>x>y; | ^ In file included from /usr/include/c++/13/string:54: /usr/include/c++/13/bits/basic_string.h:3870:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’ 3870 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3870:5: note: template argument deduction/substitution failed: sticle.cpp:8:12: note: ‘std::basic_istream<char>::__istream_type’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ 8 | cin>>x>y; | ^ /usr/include/c++/13/bits/basic_string.h:3884:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)’ 3884 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3884:5: note: template argument deduction/substitution failed: sticle.cpp:8:12: note: ‘std::basic_istream<char>::__istream_type’ {aka ‘std::basic_istream<char>’} is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ 8 | cin>>x>y; | ^ /usr/include/c++/13/bits/basic_string.h:3897:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)’ 3897 | operator>(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/13/bits/basic_string.h:3897:5: note: template argument deduction/substitution failed: sticle.cpp:8:12: note: mismatched types ‘const _CharT*’ and ‘std::basic_istream<char>’ 8 | cin>>x>y; | ^ sticle.cpp:9:17: error: expected ‘)’ before ‘{’ token 9 | while (y > x | ~ ^ | ) 10 | { | ~ sticle.cpp:11:14: error: expected ‘;’ before ‘c’ 11 | x+= x | ^ | ; 12 | c++; | ~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Sticle face parte din prima categorie. 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ă.