#3957
Dându-se un număr natural n
să se afle câte numere se pot obține folosind biții acestuia.
Problema | counterase | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.01 secunde | Limita memorie |
Total: 0.1 MB
/
Stivă 0.1 MB
|
Id soluție | #57951720 | Utilizator | |
Fișier | counterase.cpp | Dimensiune | 1.16 KB |
Data încărcării | 05 Mai 2025, 09:18 | Scor / rezultat | Eroare de compilare |
counterase.cpp: In function 'int main()': counterase.cpp:33:14: error: expected unqualified-id before '[' token auto [next, bit] = divideBy2(current); ^ counterase.cpp:34:17: error: 'bit' was not declared in this scope bin += (bit + '0'); ^ counterase.cpp:35:17: error: no match for 'operator=' (operand types are 'std::string {aka std::basic_string<char>}' and '<unresolved overloaded function type>') current = next; ^ counterase.cpp:35:17: note: candidates are: In file included from /usr/include/c++/4.8/string:52:0, from /usr/include/c++/4.8/bits/locale_classes.h:40, from /usr/include/c++/4.8/bits/ios_base.h:41, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from counterase.cpp:1: /usr/include/c++/4.8/bits/basic_string.h:546:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>] operator=(const basic_string& __str) ^ /usr/include/c++/4.8/bits/basic_string.h:546:7: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const std::basic_string<char>&' /usr/include/c++/4.8/bits/basic_string.h:554:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>] operator=(const _CharT* __s) ^ /usr/include/c++/4.8/bits/basic_string.h:554:7: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const char*' /usr/include/c++/4.8/bits/basic_string.h:565:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>] operator=(_CharT __c) ^ /usr/include/c++/4.8/bits/basic_string.h:565:7: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'char' /usr/include/c++/4.8/bits/basic_string.h:580:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(std::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>] operator=(basic_string&& __str) ^ /usr/include/c++/4.8/bits/basic_string.h:580:7: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_string<char>&&' /usr/include/c++/4.8/bits/basic_string.h:592:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>] operator=(initializer_list<_CharT> __l) ^ /usr/include/c++/4.8/bits/basic_string.h:592:7: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::initializer_list<char>'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema counterase 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ă.