#include<cstdio>
#include<iostream>
using namespace std;

int main(){
	freopen("count.in","r",stdin);
	freopen("count.out","w",stdout);
	int n,x,cnt=0;
	scanf("%d %d",&n,&x);
	for(int i=1;i<=n;i++){
		int num=i;
		do{
			if(num%10==x) cnt++;  // 取个位运算
			num/=10;              // 缩位/去个位
		}while(num);
	}
	printf("%d",cnt);
	return 0;
}

0 條評論

目前还没有评论...

資訊

ID
131
時間
1000ms
記憶體
256MiB
難度
6
标签
遞交數
164
已通過
46
上傳者