python随机数调用

题目连接:http://www.shiyanbar.com/ctf/1924

明显得出三----1。

利用python随机数暴力出解

import random
a=[0,2,3,4,5,6,7,8,9]
while 1:
    random.shuffle(a)
    b = 1000 + a[1]*100 + a[2]*10 + a[3]
    c = a[4]*1000 + a[3]*100 + a[5]*10 + a[6]
    d = 10000 + a[1]*1000 + a[5]*100 + a[3]*10 + a[7]
    if b+c == d:
        print("%d %d %d" % (b, c, d))
        break
原文地址:https://www.cnblogs.com/ZQUACM-875180305/p/9673416.html