C++检查给定数字是否为4的幂的算法实现(附完整源码)

C++检查给定数字是否为4的幂的算法实现完整源码(定义,实现,main函数测试)

#include <iostream>

 bool isPowerOf4 (unsigned int n)
 {
   
    
    
     // The number should be power of 2, and should have set bit at even position
     //
     return (n &&<

猜你喜欢

转载自blog.csdn.net/it_xiangqiang/article/details/115250348