#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n, x;
long sum = 0;
cin >> n >> x;
for (int i = 1; i <= n; i++)
{
int tmp = i;
while (tmp)
{
if (tmp % 10 == x) sum++;
tmp /= 10;
}
}
cout << sum;
return 0;
}
牛客 1002 [NOIP2013]记数问题
最新推荐文章于 2024-11-01 17:00:11 发布