0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-24 00:48:47 +00:00
OI-codes/Luogu/P1980/P1980.cpp
2021-11-21 18:24:12 +08:00

24 lines
331 B
C++

#include <bits/stdc++.h>
using namespace std;
int n, x, ans;
int cntx(int num) {
int res = 0;
while (num) {
res += num % 10 == x;
num /= 10;
}
return res;
}
int main() {
cin >> n >> x;
for (int i = 1; i <= n; i++) {
ans += cntx(i);
}
cout << ans << endl;
return 0;
}