标签:amp turn public 左移 style for ever nbsp bit
1 class Solution 2 { 3 public: 4 uint32_t reverseBits(uint32_t n) 5 { 6 uint32_t res = 0; 7 for(int i = 0;i < 32;i ++) //得到从最低位到最高位的每一位数 8 { 9 res += (n >> i & 1) << (31 - i);//第0位左移31位,第1位左移30位,依次类推 10 } 11 return res; 12 } 13 };
标签:amp turn public 左移 style for ever nbsp bit
原文地址:https://www.cnblogs.com/yuhong1103/p/12629569.html