#include <bits/stdc++.h>
using namespace std;
int ans = 0;
void howmany(int x)
{
if(x == 0)
{
return;
}
else if(x % 10 == y)
{
ans++;
}
howmany(x / 10);
}
int main()
{
int n,m;
cin >> n >> m;
for(int i = n;i <= m;i++)
{
howmany(i);
}
cout << ans << endl;
return 0;
}
请统计某个给定范围[L,R]的所有整数中,数字y出现的次数。
最新推荐文章于 2024-04-17 21:05:27 发布