#include<stdio.h>
#include<string.h>
int main()
{
int i,j,n,m,count,value,a,b,num[12],k,l,f,flag,s;
while(scanf("%d%d",&n,&m)==2)
{
count=0;
for(i=n;i<=m;i++)
{
value=i;
flag=0;
for(s=0;s<=9;s++)
num[s]=0;
while(value!=0)
{
a=value%10;
b=value/10;
value=b;
if(num[a]==0)
num[a]=1;
else if(num[a]==1)
{ flag=1;
break;
}
}
if(flag!=1)
count++;
}
printf("%d\n",count);
}
return 0;
}
ACM Problem Solution : 12527 - Different Digits
Labels:
ACM
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment