#include<stdio.h>标签:count,10,return,语言,int,scanf,++,数据,统计 From: https://blog.51cto.com/u_15835473/5847939
int main()
{
int count=0;
int n, k,i;
scanf("%d %d", &n, &k);
for (i = n; i <= k; i++)
{
int j=i;
while(j>0)
{
if (j % 10 == 2) //取余
{
count++;
}
j = j / 10; //移动到前一位
}
}
printf("%d\n", count);
return 0;
}