为什么呀!!!!

P1618 三连击(升级版)

Chenyuanyang0001 @ 2017-07-03 16:59:33

#include<iostream>
using namespace std;
int main()
{
    int i,a,b,c,x1,x2,x3,y1,y2,y3,z1,z2,z3,yi,er,san,r=0;
    cin>>a>>b>>c;
    for(i=123;i<=999;i++){yi=i;er=i*1.0*b/a;san=i*1.0*c/a;
            x1=yi/100;x2=yi/10%10;x3=yi%10;
            y1=er/100;y2=er/10%10;y3=er%10;
            z1=san/100;z2=san/10%10;z3=san%10;
              if(x1+x2+x3+y1+y2+y3+z1+z2+z3==45&&x1*x2*x3*y1*y2*y3*z1*z2*z3==362880)cout<<yi<<" "<<er<<" "<<san<<endl;
              else r+=1;
              if(r==876)cout<<"No!!!";}
    return 0;
}

|