fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <cmath>
  4.  
  5. enum COLLISION {
  6. C_ON = 1,// 00001
  7. C_EX = 2,// 00010
  8. BOX = 4,// 00100
  9. POLYGON = 8,// 01000
  10. OCTREE = 16// 10000
  11. };
  12. int main()
  13. {
  14. int c = C_ON | BOX;
  15.  
  16. if(c & C_ON) std::cout << "c_on" << std::endl;
  17. else std::cout << "c_off" << std::endl;
  18. if(c & C_EX) std::cout << "c_ex" << std::endl;
  19. if(c & BOX) std::cout << "box" << std::endl;
  20. if(c & POLYGON) std::cout << "polygon" << std::endl;
  21. if(c & OCTREE) std::cout << "octree" << std::endl;
  22. }
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
c_on
box