Project Euler #183: Maximum product of parts

  • + 0 comments

    Can anybody suggest for an optimised function to chck for terminating part I tried as:

    bool check_terminating(int deno) {
        while (true) {
            if (deno % 5 == 0)
                deno /= 5;
            else
                break;
        }
        while (true) {
            if (deno % 2 == 0)
                deno /= 2;
            else
                break;
        }
        if (deno > 1)
            return false;
        return true;
    }