觞羰涙 @ 2017-08-13 15:09:30
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
int k[10]={0,1,2,3,4,5,6,7,8,9},v[10],a,b,c;
using namespace std;
queue<int>s;
void fuck(int x)
{
int m;
if(x%a==0)
{
int k1=x/a*b,k2;
if(k1%b==0)
{
k2=k1/b*c;
for(int i=1;i<=2;i++)
{
if(i==1)m=k1;
else m=k2;
while(m>0)
{
if(v[m%10]!=0)
{
while(s.empty()!=true)
{
v[s.front()]=0;
s.pop();
}return;
}
else
{
v[m%10]=1;
s.push(m%10);
}
m/=10;
}
}
cout<<x<<" "<<k1<<" "<<k2<<endl;
while(s.empty()!=true)
{
v[s.front()]=0;
s.pop();
}
}
}
}
void sexy(int x,int t)
{
if(t==3)
{
fuck(x);
return;
}
for(int i=1;i<=9;i++)
{
if(!v[i])
{
v[i]=1;
sexy(x*10+k[i],t+1);
v[i]=0;
}
}
}
int main()
{
v[0]=1;
cin>>a>>b>>c;
sexy(0,0);
return 0;
}
by xun薰 @ 2017-08-13 15:20:19
我编译了没有啊
by huangzirui @ 2017-08-16 15:53:20
数据开小了,开大点。加个10什么的。
by huangzirui @ 2017-08-16 15:54:20
@觞羰涙 叫这名字也是醉人,差点输不出来了。
by 觞羰涙 @ 2017-08-16 16:38:01
@ huangzirui 我试试
by 觞羰涙 @ 2017-08-16 16:38:22
@huangzirui
by 觞羰涙 @ 2017-08-16 16:38:49
@huangzirui
by 觞羰涙 @ 2017-08-16 16:39:35
@huangzirui 额刚刚一看我之前已经改对了。。。
by lvfh @ 2017-08-24 17:33:44
那个,程序写出来是让人看的,那个“fuck”......
by 觞羰涙 @ 2017-08-28 13:57:56
@lvfh 个人爱好哈哈