质因数分解统计

int divide(int number)
{
    int tot = 0;
    for (int i = 2; i <= number; i++)
    {
        if (number % i == 0)
        {
            tot++;
            prime[tot] = i;
            while (number % i == 0)
            {
                prime_num[tot]++;
                prime_num[tot] %= mod;
                number /= i;
            }
        }
    }
    return tot;
}
posted on 2020-08-08 17:10  xlinsist  阅读(158)  评论(0编辑  收藏  举报