#include<stdio.h>
main()
{
int n,m,s,t;
scanf("%d",&t);
while(t--)
{
s=0;
scanf("%d%d",&n,&m);
while(n)
{
n=n/m;
s=s+n;
}
printf("%d\n",s);
}
}
我觉得我得回小学好好学习了>。<
人类真是机智啊!
#include<stdio.h>
main()
{
int n,m,s,t;
scanf("%d",&t);
while(t--)
{
s=0;
scanf("%d%d",&n,&m);
while(n)
{
n=n/m;
s=s+n;
}
printf("%d\n",s);
}
}
我觉得我得回小学好好学习了>。<
人类真是机智啊!