#14841: C++ AC


elvisliu (方塊)


#include <iostream>
using namespace std ;
int main() {
int n,x;
while(cin>>n>>x)
{
int ans=0;
for(int i=1; i<=n; i++)
{
int temp=i;
while(temp)
{
if(temp%10==x) ans++;
temp/=10;
}
}
cout<<ans<<'\n';
}
}