求助
查看原帖
求助
679376
luoguxiaobai楼主2024/1/21 06:37
#include<iostream>
#include<cmath>
using namespace std;
int main(){
	int a,b;
	scanf("%d%d",&a,&b);
	int ac=0;
	for(int i=1;i<=a;++i){
		int c = i;
		while(c>0){
			int d = c%10;
			ac = b==d?ac+1:ac;
			c = c/10;
		}
	}
	printf("%d",ac);
return 0;
}

有啥办法让他更快一些,其他的方法不会了,谢谢,求助。

2024/1/21 06:37
加载中...