题目链接:https://www.luogu.com.cn/problem/P1008
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int st[20];
bool split(int x)
{
while (x)
{
int t = x % 10;
if (t == 0) return false;
st[t]++;
x /= 10;
}
return true;
}
bool judge()
{
for (int i = 1; i <= 9; i++)
if (st[i] != 1)
return false;
return true;
}
int main()
{
for (int i = 100; i <= 333; i++)
{
int j = i * 2, k = i * 3;
memset(st, 0, sizeof st);
if (split(i) && split(j) && split(k) && judge())
{
printf("%d %d %d\n", i, j, k);
}
}
return 0;
}