因子能分解为2,3,5的为丑数
class Solution { public: bool isUgly(int num) { if(num<=0) return 0; if(num<=5) return 1; return isUgly(num%2==0?num/2:0)||isUgly(num%3==0?num/3:0)||isUgly(num%5==0?num/5:0); } };