这道是我最喜欢的位运算~
class Solution {
public:
uint32_t reverseBits(uint32_t n) {
uint32_t ans = 0;
int t = 31;
while(n)
{
uint32_t a = n & 1;
n = n>>1;
a = a<<t;
ans ^= a;//(uint32_t)(a<<t);
t--;
}
return ans;
}
};