public class Solution {
// you need treat n as an unsigned value
public int reverseBits(int n) {
int ans = 0;
for(int i = 0; i<32; i++){
//二进制最后一位bit
int bit = n&1;
n = n >> 1;
ans = (ans << 1) + bit;
}
return ans;
}
}



