Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- long long a[550],p,i,j,k,n,m,flag,x,l, c;
- while(scanf("%lld%lld",&n,&m)==2)
- {
- c=0;
- flag=0;
- for(i=n;i<=m;i++)
- {
- x=i;
- l=0;
- while(x!=0)
- {
- p=x%10;
- x=x/10;
- a[l]=p;
- l++;
- }
- for(j=0;j<l;j++)
- {
- for(k=j+1;k<l;k++)
- {
- if(a[j]!=a[k])
- {
- flag=0;
- }
- else
- {
- flag=1;
- break;
- }
- }
- if(flag==1)
- {
- break;
- }
- }
- if(flag==0)
- {
- c++;
- }
- }
- printf("%lld\n",c);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement