usercppzyw @ 2024-10-10 19:55:11
#include<bits/stdc++.h>
using namespace std;
bool fun(int x,int y,int z)
{
bool a[10]= {0,0,0,0,0,0,0,0,0,0};
a[x/100]=1;
a[x/10%10]=1;
a[x%10]=1;
a[y/100]=1;
a[y/10%10]=1;
a[y%10]=1;
a[z/100]=1;
a[z/10%10]=1;
a[z%10]=1;
for(int i=1; i<=9; i++)
{
if(a[i]==0)
{
return 0;
}
}
return 1;
}
bool funs(int x)
{
if(x/100==x/10%10||x/10%10==x%10||x/100==x/10%10)
{
return 0;
}
return 1;
}
int main()
{
bool f=1;
float a,b,c;
scanf("%f %f %f",&a,&b,&c);
for(int i=123; i<=987; i++)
{
if(!funs(i))
continue;
for(int j=123; j<=987; j++)
{
if(!funs(j))
continue;
for(int k=123; k<=987; k++)
{
if(!funs(k))
continue;
if(fun(i,j,k)&&i/a==j/b&&j/b==k/c)
{
printf("%d %d %d\n",i,j,k);
f=0;
}
}
}
}
if(f)
{
cout<<"No!!!";
}
return 0;
}
by LiTaiBai @ 2024-10-12 18:35:44
emm--- 你试试不开02优化,可能就60分了(啊啊啊我也正在写啊)