NYOJ阶乘因式分解

来源:互联网 发布:随机滚动抽奖软件 编辑:程序博客网 时间:2024/05/14 02:53
#include <stdio.h> 
int main () {
int a,b,c,e,f,g;
scanf ("%d",&a);
while(a>0){
scanf("%d%d",&b,&c);
e=0;
for (f=c;f<=b&&f>=c;f++){
for (g=f;g%c==0&&g>=c;){
g=g/c;
e++;
}
}
printf("%d\n",e);
a--;
}
return 0;
}
0 0