【C++代码】之《2的整数幂》
(1)常规解法#include <iostream>#include <stack>#include <vector>using namespace std;bool IsPowerOf2(int num){ if (num <= 0) { return false; } else { while (num % 2 == 0)