标签:
Problem Definition:
Given an integer, write a function to determine if it is a power of two.
Solution:
class Solution: # @param {integer} n # @return {boolean} def isPowerOfTwo(self, n): if n<1: return False while n!=0: if n==1: return True b=n%2 if b==1: return False n=n/2
标签:
原文地址:http://www.cnblogs.com/acetseng/p/4649516.html