80分蒟蒻求救
查看原帖
80分蒟蒻求救
716379
laiyanyu楼主2023/5/28 17:44
#include <bits/stdc++.h>
using namespace std;
long long k,m,t,s;
bool check(int n)
{
	while(n>0)
	{
		int w=n%10;
		n/=10;
		if(w>=k) return 0;
	}
	return 1;
}
int main()
{
	cin >> k >> m;
	while(1)
	{
		t++;
		s=m*t;
		if(check(s)) {
			cout << s;
			return 0;
		}
	}
}
2023/5/28 17:44
加载中...