
LeetCode p231 Power of Two 题解
1.题目:
Given an integer, write a function to determine if it is a power of two.
题意:
输入一个int型整数,判断他是否为2的几次方。
2.解题思路:
见代码,注意细节&防止越界。
3.代码
1 |
|

Given an integer, write a function to determine if it is a power of two.
题意:
输入一个int型整数,判断他是否为2的几次方。
见代码,注意细节&防止越界。
1 |
|
近期评论