fork(1) download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. int bit = 0;
  6. bit |= 1;
  7. bit |= 2;
  8. bit |= 4;
  9. bit |= 8;
  10.  
  11. if ((bit & 1) && (bit & 2) && (bit & 8)) {
  12. std::cout << "a" << std::endl;
  13. }
  14. else {
  15. std::cout << "b" << std::endl;
  16. }
  17.  
  18. if (bit & (1 | 2 | 8)) {
  19. std::cout << "a" << std::endl;
  20. }
  21. else {
  22. std::cout << "b" << std::endl;
  23. }
  24. }
  25.  
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
a
a