WA ON#7求助

P1618 三连击(升级版)

Oliver_Kahn @ 2024-05-20 20:19:26

#include<iostream>
using namespace std;
int main(){
    int d,e,f;
    cin>>d>>e>>f;
    if(d<1)
    {
        cout<<"No!!!";
        return 0;
    }
    if(d!=1&&e%d==0&&f%d==0)
    {
        d=2;
        e=e/d;
        f=f/d;
    }
    int k=0;
for(int i=123;i<=329;i++)
{
int a,b,c;
a=i;
if(e%d==0)
b=a*(e/d);
else b=a*e;
if(f%d==0)
c=a*(f/d);
else c=a*f;
if(a%10+b%10+c%10+a/10%10+b/10%10+c/10%10+a/100+b/100+c/100==45&&(a%10)*(b%10)*(c%10)*(a/10%10)*(b/10%10)*(c/10%10)*(a/100)*(b/100)*(c/100)==1*2*3*4*5*6*7*8*9)
{cout<<a<<" "<<b<<" "<<c<<endl;
k=1;}
}
if(k==0)cout<<"No!!!";
return 0;
}

by J_ALVAREZ @ 2024-05-20 21:21:18

布什各门,财久多炼 @Oliver_Kahn


by Oliver_Kahn @ 2024-05-20 21:21:57

@Emiliano_Martinez 咋写,帮帮我


|