睡在墙上的猫 @ 2016-07-30 21:19:29
#include<iostream>
using namespace std;
int main()
{
int x,y,z,flag=1,i,j,num[4],a[10],book[100],k,u;
cin>>x>>y>>z;
for (i=100;i<=999;i++)
{
num[1]=i*x;
num[2]=i*y;
num[3]=i*z;
a[1]=num[1]/100;
a[2]=num[1]/10%10;
a[3]=num[1]%10;
a[4]=num[2]/100;
a[5]=num[2]/10%10;
a[6]=num[2]%10;
a[7]=num[3]/100;
a[8]=num[3]/10%10;
a[9]=num[3]%10;
for (j=1;j<=9;j++)
{
book[j]=0;
}
for (k=1;k<=9;k++)
{
book[a[k]]=1;
}
int sum=0;
for (u=1;u<=9;u++)
{
sum=sum+book[u];
}
if (sum==9)
{
cout<<num[1]<<" "<<num[2]<<" "<<num[3]<<endl;
flag=0;
}
}
if (flag==1) cout<<"No!!!";
return 0;
}
by 李蕴奇 @ 2016-09-07 20:54:17
超界了吧
by wisdom_grass @ 2016-10-15 14:58:28
我下载数据
读入 123 456 789
输出 123 456 789
by wisdom_grass @ 2016-10-15 14:59:14
这是真的