诸位大神,路过帮忙看看毛病,感觉还对啊

P1618 三连击(升级版)

TSWorld @ 2018-10-13 15:03:49

include<iostream>

include<cstdlib>

include<cstdio>

include<algorithm>

include<cstring>

using namespace std; bool vis[15]; void run(int n) { while(n!=0) { vis[n%10]=1; n=n/10;
}
} int main() { int a=0,b=0,c=0,a1=0,b1=0,c1=0; bool anwser=true,is=false; scanf("%d%d%d",&a,&b,&c); for(int i=1;i<=9;i++) for(int j=1;j<=9;j++) for(int k=1;k<=9;k++) { a1=i100+j10+k; int x=a1/a; if(a1%x!=0||a!=a1/x) continue; b1=xb; c1=xc; memset(vis,0,sizeof(vis)); run(a1); run(b1); run(c1); for(int z=1;z<=9;i++) if(!vis[z])anwser=false;

      if(anwser)
        {cout<<a1<<" "<<b1<<" "<<c1<<endl;is=true;}             
    }
    if(!is)
     printf("No");
    return 0;

}


|