fork(2) download
  1. /// $ c++ -std=c++11 *.cc && ./a.out
  2. #include <bitset>
  3. #include <cstdlib>
  4. #include <iostream>
  5. #include <limits>
  6.  
  7. int main()
  8. {
  9. uint64_t n;
  10. if (!(std::cin >> n)) std::exit(EXIT_FAILURE);
  11. std::bitset<std::numeric_limits<decltype(n)>::digits> bits{n};
  12. std::cout << bits.to_string();
  13. }
  14.  
Success #stdin #stdout 0s 16048KB
stdin
123
stdout
0000000000000000000000000000000000000000000000000000000001111011