为啥最后一个测试点会WA,输出No!!! 求大佬解释一下,呜呜呜
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
int s[10];
int gcd(int a,int b){
while(b!=0){
int t=b;
b=a%b;
a=t;
}
return a;
}
int gcd3(int a,int b,int c){
int t=gcd(a,b);
return gcd(t,c);
}
bool iszero(int n){
int flag=0;
while(n>0){
int t=n%10;
if(t==0){
flag=1;break;
}
n=n/10;
}
if(flag)return false;
return true;
}
bool isonly(int x,int y,int z){
while(x>0){
int t=x%10;
s[t]++;
x=x/10;
}
while(y>0){
int t=y%10;
s[t]++;
y/=10;
}
while(z>0){
int t=z%10;
s[t]++;
z/=10;
}
if(s[0]==0&&s[1]==1&&s[2]==1&&s[3]==1&&s[4]==1&&s[5]==1&&s[6]==1&&s[7]==1&&s[8]==1&&s[9]==1)
return true;
else return false;
}
int a,b,c;
int main(){
int gg=0;
scanf("%d%d%d",&a,&b,&c);
int result=gcd3(a,b,c);
a=a/result,b=b/result,c=c/result;
for(int i=111;i<1000;i++){
int x=a*i,y=b*i,z=c*i;
if(iszero(x)&&iszero(y)&&iszero(z)&&y>100&&y<1000&&z>100&&z<1000){
memset(s,0,sizeof(s));
if(isonly(x,y,z)){
printf("%d %d %d\n",x,y,z);
gg=1;
}
}
}
if(gg==0){
printf("No!!!");
}
return 0;
}