0
已解决
冯卓琳
新手守护
新手守护
#include<iostream>
using namespace std;
int main(){
for(int i=123;i<=987/3;i++){
int x=i*2,y=i*3;
memset(a,0,sizeof(a));
a[i%10]++;
a[i%100/10]++;
a[i/100]++;
a[x%10]++;
a[x%100/10]++;
a[x/100]++;
a[y%10]++;
a[y%100/10]++;
a[y/100]++;
bool f=false;
for(int j=1;j<=9;j++){
if(a[j]!=1){
f=true;
break;
}
}
if(!f) cout<<i<<" "<<x<<" "<<y<<endl;
}
return 0;
}
1
已采纳
钱寅虎
初级守护
初级守护
cout<<"192"<<" "<<"384"<<" "<<"576"<<endl;
cout<<"219"<<" "<<"438"<<" "<<"657"<<endl;
cout<<"273"<<" "<<"546"<<" "<<"819"<<endl;
cout<<"327"<<" "<<"654"<<" "<<"981";
0