实现自Matrix67!
//二进制逆序
//分治思想
//程序读入一个32位整数并输出它的二进制倒序后所表示的数
#include <stdio.h>
int main() {
int n;
while (scanf("%d", &n) != EOF) {
n = (n & 0x55555555) << 1 | (n & 0xAAAAAAAA) >> 1;
n = (n & 0x33333333) << 2 | (n & 0xCCCCCCCC) >> 2;
n = (n & 0x0F0F0F0F) << 4 | (n & 0xF0F0F0F0) >> 4;
n = (n & 0x00FF00FF) << 8 | (n & 0xFF00FF00) >> 8;
n = (n & 0x0000FFFF) << 16 | (n & 0xFFFF0000) >> 16;
printf ("%d\n", n);
}
return 0;
}