您的位置:首页 > 编程语言 > Python开发

Python-Project Euler 52

2014-01-20 17:48 260 查看
f=[]

def cl(x):

    global f

    

    f=[]

    while x>0:

        s=x%10

        if s not in f:

            f.append(s)

        x//=10

def check(x):

    global f

    while x>0:

        s=x%10

        if s not in f:

            return False

        x//=10

    return True

for i in range(1,1000000):

    cl(i)

    if check(2*i) and check(3*i) and check(4*i) and check(5*i) and check(6*i):

        print(i)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: