0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-05 02:26:26 +00:00
OI-codes/Luogu/P1618/P1618.cpp

29 lines
686 B
C++
Raw Normal View History

#include <iostream>
2022-06-01 01:45:41 +00:00
#include <algorithm>
using std::cin;
using std::cout;
#define endl '\n'
int a, b, c,
f[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
bool flag = false;
int main() {
std::ios::sync_with_stdio(false);
cin >> a >> b >> c;
do {
int aa = f[0] * 100 + f[1] * 10 + f[2],
bb = f[3] * 100 + f[4] * 10 + f[5],
cc = f[6] * 100 + f[7] * 10 + f[8];
if (aa * b == bb && aa * c == cc || aa == a && bb == b && cc == c) {
flag = true;
cout << aa << ' ' << bb << ' ' << cc << endl;
}
} while (std::next_permutation(f, f + 9));
if (!flag) {
cout << "No!!!" << endl;
}
return 0;
}