https://www.luogu.com.cn/problem/P1980
#include<bits/stdc++.h>
using namespace std;
long long n, x, ans;
int a = 0;
string s;
char c;
int main(){
cin>>n>>x;
c = x + '0';
for(long long i = 0; i <= n; i++){
long long xx = i;
while(xx){
s[a++] = (xx % 10 + '0');
xx /= 10;
}
}
for(int i = 0; i <= a; i++){
if(s[i] == c) ans++;
}
cout<<ans;
return 0;
}
为什么此代码的a++会导致RE