dghcs @ 2020-02-28 21:27:57
#include<iostream>
using namespace std;
int a,b,c;
bool flag = false;
int main()
{
cin >> a >> b >> c;
for(int i = (123/a)*a;i <= 345;i+=a)
{
int j = (i*b)/a;
int k = (i*c)/a;
if((i%10)+(i/100)+(i/10%10)+(j%10)+(j/100)+(j/10%10)+(k%10)+(k/100)+(k/10%10)==45&&(i%10)*(i/100)*(i/10%10)*(j%10)*(j/100)*(j/10%10)*(k%10)*(k/100)*(k/10%10)==362880)
cout << i <<" "<< j <<" "<< k <<endl,flag = 1;
}
if(!flag)
cout << "NO!!!";
}
by WanderingTrader @ 2020-04-02 18:51:20
您就不能用全排列做吗??
by mamingxiao @ 2020-10-26 14:32:09
@dghcs "o"要小写