#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
int i,j,k;
scanf("%d %d %d",&i,&j,&k);
int c=0;
for(int t=i;t<=j;t++)
{
int p=t;
int sum=0;
while(p>0)
{
sum=sum*10+(p%10);
p=p/10;
}
if(abs(t-sum)%k==0)
c++;
}
printf("%d",c);
return 0;
}
No comments:
Post a Comment