77Glorious @ 2023-10-28 22:37:49
#include <bits/stdc++.h>
using namespace std;
int a[10];
void pd(int x) {
int tmp;
while (x != 0) {
tmp = x % 10; //123->3
x = x / 10; //123->12
a[tmp]++; //判断每个数位是否占位为1
}
}
int zw[2];//占位数组
int A, B, C;
int i ;
int main() {
cin >> A >> B >> C;
if (A == 0) {
cout << "No!!!";
return 0;
}
for (i = 123; i <= 333; i++) {
pd(i);
pd(i / A * B);
pd(i / A * C);
if (a[1] == 1 && a[2] == 1 && a[3] == 1 && a[4] == 1 && a[5] == 1 && a[6] == 1 && a[7] == 1 && a[8] == 1 && a[9] == 1
&& i / A * B < 999 && i / A * C <= 999) {
cout << i << ' ' << i / A *B << ' ' << i / A *C << endl;
zw[1] = i;
}
for (int j = 1; j <= 9; j++)
a[j] = 0;
}
if (zw[1] == 0)
cout << "No!!!";
return 0;
}
by donaldqian @ 2023-10-28 22:46:19
不太清楚是不是要判断一下
by donaldqian @ 2023-10-28 22:48:35
还有
例如
by 77Glorious @ 2023-10-28 22:57:08
感谢大佬提醒倍数判断!@donaldqian0712