-
-
Save b4284/19ace595c99b880ca110de03bbc1da64 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void q2(int n) { | |
| bool shown = false; | |
| char one_zero; | |
| int n2 = 0x80; | |
| CAL: | |
| if (n >= n2) { | |
| n -= n2; | |
| one_zero = '1'; | |
| } else { | |
| one_zero = '0'; | |
| } | |
| if (shown) { | |
| putchar('_'); | |
| putchar(one_zero); | |
| } else { | |
| if (one_zero == '1' || n2 == 1) { | |
| shown = true; | |
| putchar(one_zero); | |
| } | |
| } | |
| if (n2 > 1) { | |
| n2 /= 2; | |
| goto CAL; | |
| } else { | |
| putchar('\n'); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment