#include <stdio.h>
int main()
{
int test(int a,int b);
int a, b;
scanf("%d %d",&a,&b);
int z=test(a,b);
printf("%d",z);
return 0;
}
int test(int a,int b)
{
int c=0;
int i;
for(i=a;i<=b;i++)
{
int sam;
int temp=i;
while (temp>0)
{
sam=temp%10;
if(sam==2)
{
c++;
}
temp/=10;
}
}
return c;
}

京公网安备 11010502036488号