The problem statement is very easy. Given a number n you have to determine the largest power of m,not necessarily prime, that divides n!.InputThe input file consists of several test cases. The first line in the file is the number of cases to handle.The…
曾经做过一个类似的 求n!中有多少个质因子m 这里有一个结论 k = n/m+n/(m^2)+n/(m^3)+.... int getnum(int n, int m) { int sum = 0; while(n) { sum += n/m; n /= m; } return sum; } 然后这个题就比较容易了 /************************************************************************* > Author: xlc28…