80分求调!!!求大佬们帮调
查看原帖
80分求调!!!求大佬们帮调
1747590
totomac楼主2025/8/3 21:52

明明可以正常输出No,还是有问题,求大佬们帮调

#include <bits/stdc++.h>
using namespace std;
int main(){
	bool e;
	int a,b,c,d;
	cin>>a;
	for(int i=10000;i<=30000;i++){
		b=i/100;
		c=i/10-i/10000*1000;
		d=i-i/1000*1000;
		if(b%a==0&&c%a==0&&d%a==0){
			cout<<i<<endl;
			e=true;
		}
	}
	if(e==false){
		cout<<"No"<<endl;
	}
}
2025/8/3 21:52
加载中...