• Cursos
  • Compilador de Código
  • Discutir
  • Preços
  • Teams
Menu

Q&A Discussões

Выгодно ли использовать <bitset>
binarybitsetc++
0 Voto
2 Respostas
6th Jan 2018, 12:03 AM
Данил Кудрицкий
Данил Кудрицкий - avatar
Is it possible to get a part from bitset<8> and put it into bitset<6>
<bitset>cpp
1 Voto
1 Resposta
4th Jun 2018, 9:32 AM
Ixidot
Ixidot - avatar
#include <iostream> #include <bitset> int main() { int myDecimalNumber; std::cin >> myDecimalNumber; std::string binary = std::bitset<8>(myDecimalNumber).to_string(); //to binary std::cout<<binary<<"\n"; unsigned long decimal = std::bitset<8>(binary).to_long(); std::cout<<decimal<<"\n"; return 0; }
c++
2 Votos
5 Respostas
18th Jun 2016, 10:43 PM
Utpal Kumar
Utpal Kumar - avatar
Quente hoje
Fix code
0 Votes
Fast coding (mobile)
1 Votes
..
1 Votes
Beginner_to_SoloLearn
2 Votes
How to learn C++ and how long does it take
1 Votes
Coding help
2 Votes
DSA doubt
1 Votes
Bridge pattern use case
0 Votes
Recover challenge history
0 Votes
Data structure using C
0 Votes