fork(1) download
  1. #include <iostream>
  2. #include <bitset>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. std::bitset<4> flags;
  8. flags.set(1);
  9. flags.set(3);
  10. std::cout << flags.to_string() << std::endl;
  11. std::cout << flags.to_ulong() << std::endl;
  12. return 0;
  13. }
Success #stdin #stdout 0s 3228KB
stdin
Standard input is empty
stdout
1010
10