fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. unsigned int c = 0x1234;
  6. unsigned int b = (c & 0xf) | ((c & 0xf0) << 4) |
  7. ((c & 0xf00) << 8) | ((c & 0xf000) << 12);
  8. b |= (b << 4);
  9.  
  10. printf("%x -> %x", c, b);
  11. return 0;
  12. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
1234 -> 11223344