标签:problems http script ble code bool etc 判断 isp
给定一个整数,写一个函数来判断它是否是2的幂。
详见:https://leetcode.com/problems/power-of-two/description/
class Solution { public: bool isPowerOfTwo(int n) { return (n>0)&&(!(n&(n-1))); } };
标签:problems http script ble code bool etc 判断 isp
原文地址:https://www.cnblogs.com/xidian2014/p/8758944.html