[NOIP 2013 普及组 T1] 计数问题
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, x, cnt = 0;
cin >> n >> x;
for (int i = 1; i <= n; i++)
{
int t = i;
while (t)
{
if (t % 10 == x)
cnt++;
t /= 10;
}
}
cout << cnt << endl;
return 0;
}