class Solution {
public:
uint32_t reverseBits(uint32_t n) {
uint32_t sum = 0;
int i = 0;
while(n>0 && i < 32)
{
sum |= (n & 1) << (31 - i);
n >>= 1;
i++;
}
return sum;
}
};
leetcode每日一题第127天
最新推荐文章于 2024-11-04 12:20:00 发布