#include<bits/stdc++.h> using namespace std; int main() { int n,x; cin>>n>>x; int res=0; for(int i=1;i<=n;i++) //枚举范围 { int t=i; while(t) //拆数模板 { int ge=t%10; if(ge==x) { res++; } t/=10; } } cout<<res; return 0; }
Using your lizikid universal account