标签:isp code false inf turn lse 图片 alt ==
class Solution { public: bool isPowerOfThree(int n) { if (n < 1) return false; while (n % 3 == 0) n /= 3; return n == 1; } };
LeetCode 326. 3的幂 Power of Three
标签:isp code false inf turn lse 图片 alt ==
原文地址:https://www.cnblogs.com/ZSY-blog/p/12989732.html