首页
Java
登录
6mi
u
盘
搜
搜 索
Java
leetcode+位操作,求反
leetcode+位操作,求反
xiaoxiao
2021-02-28
31
点击打开链接 class Solution { public: uint32_t reverseBits(uint32_t n) { uint32_t result = 0; int bit = 0; for(int i=0; i<32; i++){ bit = n&1;//一次求出从低位到高位的数字来 n = n>>1; result = 2*result+bit; } return result; } };
转载请注明原文地址: https://www.6miu.com/read-2629740.html
技术
最新回复
(
0
)