题解 | 记数问题
记数问题
https://www.nowcoder.com/practice/28b2d9f2bf2c48de94a1297ed90e1732
#include <iostream>
using namespace std;
int main() {
long long n,x,num=0;
cin>>n>>x;
while(n){
long long k=n;
while(k){
if(k%10==x){
num++;
}
k/=10;
}
n--;
}
cout<<num;
return 0;
}
// 64 位输出请用 printf("%lld")