标签:
given an integer,write a function to determine if it is a power of three.
class Solution { public: bool isPowerOfThree(int n) { if(n<1) return false; else if(n==1) return true; else return n%3==0&&isPowerOfThree(n/3); } };
标签:
原文地址:http://www.cnblogs.com/xiaoying1245970347/p/5114192.html