fork download
  1. #include <stdio.h>
  2. #include <stdint.h>
  3.  
  4. #define B_TO_UINT1(b00) (((uint32_t) b00 << 0))
  5. #define B_TO_UINT2(b01, ...) (((uint32_t) b01 << 1) | B_TO_UINT1(__VA_ARGS__))
  6. #define B_TO_UINT3(b02, ...) (((uint32_t) b02 << 2) | B_TO_UINT2(__VA_ARGS__))
  7. #define B_TO_UINT4(b03, ...) (((uint32_t) b03 << 3) | B_TO_UINT3(__VA_ARGS__))
  8.  
  9. int main(void) {
  10. // your code goes here
  11. uint32_t cmd;
  12. cmd = B_TO_UINT1(1); // line_1
  13. cmd = B_TO_UINT2(1, 0); // line_2
  14. cmd = B_TO_UINT3(0, 1, 1); // line_3
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
Standard output is empty