Leetcode 190. Reverse Bits

来源:互联网 发布:鹰视眼监控软件app 编辑:程序博客网 时间:2024/06/14 01:09

  public int reverseBits(int n) {


int result = 0;


for (int i = 0; i < 32; i++) {
result = result << 1;

result+=n&1;

n = n >> 1;


}


return result;


}

原创粉丝点击