int c = 0; while( x ) { c++; x = (x & (x - 1)); }
该方法比直接移动的次数肯定要少。效率更高!
posted on 2018-01-05 16:11 mdumpling 阅读(176) 评论(0) 编辑 收藏 举报
Powered by: 博客园 Copyright © 2024 mdumpling Powered by .NET 8.0 on Kubernetes