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.

22 lines
682 B

#include <bits/stdc++.h>
using namespace std;
int main() {
for (int i = 1; i <= 9; i++) {
for (int j = 0; j <= 9; j++) {
for (int k = 0; k < 9; ++k) {
for (int l = 0; l < 9; ++l) {
for (int m = 0; m < 9; ++m) {
if (i == j || i == k || i == l || j == k || j == l || k == l) continue;
if ((i * 1000 + j * 100 + k * 10 + l) * m == (l * 1000 + k * 100 + j * 10 + i)) {
cout << i << j << k << l << "," << m << endl;
}
}
}
}
}
}
return 0;
}