Skip to content

Instantly share code, notes, and snippets.

@314maro
Created April 20, 2014 07:02
Show Gist options
  • Save 314maro/11107224 to your computer and use it in GitHub Desktop.
Save 314maro/11107224 to your computer and use it in GitHub Desktop.
v('ω')v
#include <stdio.h>
int main(void) {
int x, a, b;
scanf("%x",&x);
if (x < 0x20 || 0xDF < x) {
printf("error: %d\n", x);
return -1;
}
a = (x & 0xE0) >> 5;
b = x & 0x1F;
printf("a:%0#4x, b:%0#4x, 0x20*a+b:%0#4x\n", a, b, 0x20*a+b);
}
@314maro
Copy link
Author

314maro commented Apr 20, 2014

∠( 'ω')/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment