You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
823 B

2 years ago
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int a[10];
/**
STL
do {
} while (next_permutation(a + 1, a + 10));
1使
2
3
*/
int main() {
LL A, B, C, x, y, z, cnt = 0;
cin >> A >> B >> C;
for (int i = 1; i <= 9; i++) a[i] = i;
do {
x = a[1] * 100 + a[2] * 10 + a[3];
y = a[4] * 100 + a[5] * 10 + a[6];
z = a[7] * 100 + a[8] * 10 + a[9];
if (x * B == y * A && y * C == z * B) //避免除法防止爆long long
printf("%lld %lld %lld\n", x, y, z), cnt++;
} while (next_permutation(a + 1, a + 10));
if (!cnt)printf("No!!!");
return 0;
}