#include<bits/stdc++.h>
using namespace std;
bool isUgly(int num)
{
if (num < 1)return false;
while (num % 2 == 0)num >>= 1;
while (num % 3 == 0)num /= 3;
while (num % 5 == 0)num /= 5;
return num == 1;
}
思路:对能被2,3,5整除的数不断除2,3,5,最后剩1就是,剩0就不是。