50分QAQ
查看原帖
50分QAQ
705879
him0715楼主2023/1/28 18:02
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;bool flag=false;
	cin>>n;
	for(int i=10000;i<=30000;i++){
		int fir=i%10000%1000%100%10;
		int sec=i/10%1000%100%10;
		int thi=i/100%100%10;
		int fou=i/1000%10;
		int fif=i/10000;
		int sub1=fir*100+sec*10+thi;
		int sub2=sec*100+thi*10+fou;
		int sub3=thi*100+fou*10+fif;
		if(sub1%n==0 && sub2%n==0 && sub3%n==0){
			flag=true;
			cout<<i<<endl;
		}
	}
	if(!flag)cout<<"No"<<endl;
	return 0;
}
2023/1/28 18:02
加载中...