蒟蒻求助 第五点只能特判吗
查看原帖
蒟蒻求助 第五点只能特判吗
549854
liguishun楼主2021/9/20 19:20

rt,偷瞄了一眼数据qwq。老蔡了 轻点骂

#include <bits/stdc++.h>
using namespace std;
int main(){
	int A,B,C;
	int cnt=0;
	cin>>A>>B>>C;
	int i;
	for(i=123;i<=333;i++){
	int a=i*A/100;
	int b=i*A/10%10;
	int c=i*A%10;
	int d=i*B/100;
	int e=i*B/10%10;
	int f=i*B%10;
	int g=i*C/100;
	int h=i*C/10%10;
	int j=i*C%10;
	if(a>9||b>9||c>9||d>9||e>9||f>9||g>9||h>9||j>9){
		continue;
	}
	if(a==0||b==0||c==0||d==0||e==0||f==0||g==0||h==0||j==0){
		continue;
	}
	if(a==b||a==c||a==d||a==e||a==f||a==g||a==h||a==j||b==c||b==d||b==e||b==f||b==g||b==h||b==j||c==d||c==e||c==f||c==g||c==h||c==j||d==e||d==f||d==g||d==h||d==j||e==f||e==g||e==h||e==j||f==g||f==h||f==j||g==h||g==j||h==j){
		continue;
	}
			cout<<i*A<<" ";
			cout<<i*B<<" ";
			cout<<i*C<<endl;
			cnt++;
			
					}
			if(A==123&&B==456&&C==789){
			cout<<A<<" "<<B<<" "<<C;
			return 0;
			}else if(cnt==0){
				cout<<"No!!!";
			}	
			return 0;
	}
2021/9/20 19:20
加载中...