满江红
查看原帖
满江红
1349478
tangyiqi楼主2024/10/17 22:57
#include<bits/stdc++.h>
using namespace std;
int n,x,b,c,ans;
int main(){
	scanf("%d%d",&n,&x);
	for(int i = 1;i<=n;i++){
		b = i;
		while(b!=0){
			c = b%10;
			b/=10;
			if(c == x)ans++;
		}
	}
	printf("%d",&ans);
    return 0;
}
2024/10/17 22:57
加载中...