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.
32 lines
860 B
32 lines
860 B
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
bool NoChongFu(int a) {
|
|
int i_a, i_b, i_c;
|
|
i_a = a / 100;
|
|
i_b = a / 10 % 10;
|
|
i_c = a % 10;
|
|
if (i_a == i_c || i_a == i_c || i_b == i_c) return false;
|
|
return true;
|
|
}
|
|
|
|
int main() {
|
|
ios::sync_with_stdio(false); //读入输出优化的强迫症
|
|
for (int i = 100; i <= 999; i++) {
|
|
if (!NoChongFu(i)) continue;
|
|
for (int j = 100; j <= 999; j++) {
|
|
if (j == i) continue;
|
|
if (!NoChongFu(j)) continue;
|
|
for (int k = 100; k <= 999; k++) {
|
|
if (k == i) continue;
|
|
if (k == j) continue;
|
|
if (!NoChongFu(k)) continue;
|
|
if (i * 6 == j * 3 && j * 3 == k * 2) {
|
|
cout << i << " " << j << " " << k << endl;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return 0;
|
|
} |