首页 > 其他 > 详细

模拟/枚举专题

时间:2020-01-19 11:09:14      阅读:61      评论:0      收藏:0      [点我收藏+]

技术分享图片

 

 技术分享图片

 

 技术分享图片

 

 技术分享图片

 

 技术分享图片

 

 技术分享图片

 

 技术分享图片

 

 技术分享图片

 

 

#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#define N 1000
#define M 1000
using namespace std;
int time[10];
void get(int x)
{
    time[x%10]++;
    time[x/10%10]++;
    time[x/100]++;
}
int main()
{
    for(int i=100;i<=333;i++)
    {
        int x=i,y=i*2,z=i*3;
        memset(time,0,sizeof(time));
        get(x);
        get(y);
        get(z);
        bool flag=true;
        for(int j=1;j<=9;j++) if(time[j]!=1) flag=false;
        if(flag)
        {
            cout<<x<< <<y<< <<z<<endl;
        }
    }
}

技术分享图片

 

 技术分享图片 

技术分享图片

 技术分享图片

 

 

 技术分享图片

技术分享图片

技术分享图片

 

 

 

 

 

 技术分享图片

模拟/枚举专题

原文:https://www.cnblogs.com/liusu123456/p/12212537.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!