FOREIGN @ 2019-07-06 16:52:10
#include<bits/stdc++.h>
using namespace std;
int a,b,c,f=0;
int j,k;
int main()
{
cin>>a>>b>>c;
for(int i=(123/a+min(123%a,1))*a;i<=987/a*a;i+=a)
{
j=i/a*b;
k=i/a*c;
if(j>=100&&j<=999&&k>=100&&k<=999)
{
int l[10],sum=0,xx=1;
l[1]=i/100;
l[2]=i/10%10;
l[3]=i%10;
l[4]=j/100;
l[5]=j/10%10;
l[6]=j%10;
l[7]=k/100;
l[8]=k/10%10;
l[9]=k%10;
for(int _i=1;_i<=9;_i++)
{
sum+=l[_i];
xx*=l[_i];
}
if(sum==45&&xx==362880)
{
f=1;
cout<<i<<" "<<j<<" "<<k<<endl;
}
}
}
if(f==0)
cout<<"No!!!";
return 0;
}
这是新的
#include<bits/stdc++.h>
using namespace std;
int a,b,c,p1=0,p2=0,p3=0;
bool f(int i,int j,int l)
{
while(i!= 0)
{
i/=10;
p1++;
}
while(j!= 0)
{
j/=10;
p2++;
}
while(l!= 0)
{
l/=10;
p3++;
}
}
int main()
{
cin>>a>>b>>c;
for(int i=1;i<=999;i++)
for(int j=1;j<=999;j++)
for(int l=1;l<=999;l++)
if(i%a==0&&j%b==0&&l%c==0)
{
f(i,j,l);
if(i==3&&j==3&&l==3)
cout<<i<<" "<<j<<" "<<l<<endl;
p1=0;p2=0;p3=0;
}
return 0;
}
这是旧的
我很淡定... 谁愿意改一下
by charliegong @ 2019-07-06 16:53:55
什么是bob了??
by Gary818 @ 2019-07-06 17:47:15
@レム、㍕
同问,什么是bob了??
by FOREIGN @ 2019-07-06 17:52:16
@海阔天空818 炸了
by FOREIGN @ 2019-07-06 17:52:28
@charliegong 炸了