|
- #include <bits/stdc++.h>
- using namespace std;
- int x1,x2,x3,k,a[10],i,b;
- int main()
- {
- for (x1=100; x1<=999/3; x1++)
- {
- x2=x1*2,x3=x1*3;
- b=1;
- for (i=1;i<=9;i++) a[i]=1;
-
- k=x1/100%10,a[k]=0;
- k=x1/10%10,a[k]=0;
- k=x1/1%10,a[k]=0;
-
- k=x2/100%10,a[k]=0;
- k=x2/10%10,a[k]=0;
- k=x2/1%10,a[k]=0;
-
- k=x3/100%10,a[k]=0;
- k=x3/10%10,a[k]=0;
- k=x3/1%10,a[k]=0;
-
- for (i=1;i<=9;i++) if (a[i]==1) b=0;
-
- if (b==1) cout<<x1<<' '<<x2<<' '<<x3<<endl;
- }
- return 0;
- }
复制代码 |
|