1 solutions

  • 0
    @ 2025-8-12 18:35:35
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int a,b,c;
    	cin>>a>>b>>c;
    	bool st=0; 
    	for(int i=1;i*c<=999;i++)
    	{
    		int t[]={0,i*a,i*b,i*c};
    		int w[15]={};//清空数组
    		int cnt=0;
    		for(int j=1;j<=3;j++)
    		{
    			int tt=t[j];
    			while(tt)
    			{
    				int ge=tt%10;
    				if(ge<=0) cnt=10;
    				if(w[ge]==0) cnt++;	
    				w[ge]++;
    				tt/=10;
    			}	
    		} 
    		if(cnt!=9) continue;//说明只要有一个数出现了两次
    		for(int j=1;j<=3;j++)
    		{
    			cout<<t[j]<<" ";
    		} 
    		st=1;
    		cout<<endl; 
    	}
    	if(st==0)
    	{
    		cout<<"No!!!";
    	}
    	return 0;
    }
    
    
    • 1

    Information

    ID
    2878
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    3
    Tags
    # Submissions
    7
    Accepted
    3
    Uploaded By