60分究竟是为什么
  • 板块P1151 子数整数
  • 楼主luqyou
  • 当前回复3
  • 已保存回复3
  • 发布时间2022/2/10 18:58
  • 上次更新2023/10/28 09:00:17
查看原帖
60分究竟是为什么
464732
luqyou楼主2022/2/10 18:58
#include<bits/stdc++.h>
bool find_ans=0;
using namespace std;
const int n=9;
int main(){
    int k;
    cin>>k;
    for(int a=1;a<=2;a++){
        for(int b=1;b<=n;b++){
            for(int c=1;c<=n;c++){
                for(int d=1;d<=n;d++){
                    for(int e=1;e<=n;e++){
                        if((100*a+10*b+c)%k==0&&(100*b+10*c+d)%k==0&&(100*c+10*d+e)%k==0){
                        	cout<<a<<b<<c<<d<<e<<endl;
                        	find_ans=1;
						}
                    }
                }
            }
        }
    }
    if(30000%k==0){
    	cout<<30000;
    	find_ans=1;
	} 
    if(!find_ans) cout<<"No";
    return 0;
}
2022/2/10 18:58
加载中...