daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Feb 11th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (b << 8)
  2.    
  3. ((b << 8) | c))
  4.    
  5. ((a << 16) | ((b << 8) | c))
  6.    
  7. r1 = (merged & 0x00003F);
  8.    
  9. r1 = ((merged >> 0)  & 0x3F);
  10. r2 = ((merged >> 6)  & 0x3F);
  11. r3 = ((merged >> 12) & 0x3F);
  12. r4 = ((merged >> 18) & 0x3F);
  13.    
  14. char /*or int*/ a, b, c;
  15. int merged, r1, r2, r3, r4;
  16.  
  17. scanf(" %c %c %c", &a, &b, &c);
  18.  
  19. merged = ((a << 16) | ((b << 8) | c));
  20.  
  21. r1 = ((merged >> 0)  & 0x3F);
  22. r2 = ((merged >> 6)  & 0x3F);
  23. r3 = ((merged >> 12) & 0x3F);
  24. r4 = ((merged >> 18) & 0x3F);
  25.  
  26. printf("%d %d %d %dn", r1, r2, r3, r4);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top