top1编程
← 返回题目
题解

【入门】子数整除

1 条题解

  • 0
    @ 2026-7-28 23:24:07
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int k,c=0;
    	cin>>k;
    	for(int i=10000;i<=30000;i++){
    		if(i/100%k==0&&i/10%1000%k==0&&i%1000%k==0){
    			c++;
    			cout<<i<<endl;
    		}
    	}
    	if(c==0){
    		cout<<"No";
    	}
    	return 0;
    }
    
    • 1