階乘因式分解(一) 給定兩個數m,n,其中m是一個素數。 將n(0<=n<=10000)的階乘分解質因數,求其中有多少個m。 輸入第一行是一個整數s(0
數 隨后的s
行, 每行有
兩個
整數
n,
m。
輸出
輸出
m的個數。
#include <stdio.h>int main() { int t,s,n,m; scanf("%d",&s); while(s--) { scanf("%d %d",&n,&m); t=0; for(;n>0;) { n=n/m; t+=n ...
