#include
#include
char num[1000001]={0};
int ber[1000001]={0};
int main()
{int n,i;
for(n=100;n<1000001;n++)
{int i=0;
itoa(n,num,10);
int len=strlen(num);
while(num[i]>num[i+1]&&i
while(num[i]
}
int N,a,b;
scanf("%d",&N);
while(N--)
{int count=0;
scanf("%d %d",&a,&b);
for(i=a;i<=b;i++)
if(ber[i]) count++;
printf("%d\n",count);
}
}
//这个好像还是会超时,但是下面这个可以通过
#include
#include
#include
char num[1000001]={0};
int ber[1000001]={0};
int main()
{int n,c;
for(n=100;n<1000001;n++)
{int i=0;
itoa(n,num,10);
int len=strlen(num);
while(num[i]>num[i+1]&&i
while(num[i]
}
for(c=100;c<1000001;c++)
ber[c]+=ber[c-1];
int N,a,b;
scanf("%d",&N);
while(N--)
{
scanf("%d %d",&a,&b);
printf("%d\n",ber[b]-ber[a-1]);
}
}