作者: 散不开暧昧 时间: 2017-12-28 11:09
# -*- coding:utf-8 -*-
import random
import time
list=[0,1,2,3,4,5,6,7,8,9]
start_time=time.time()
while True:
slice = random.sample(list, 8)
s, e, n, d, m, o, r, y = slice
if s!=0 and m!=0:
if (s*1000+e*100+n*10+d)+(m*1000+o*100+r*10+e)==(m*10000+o*1000+n*100+e*10+y):
print s,e,n,d,m,o,r,y
break
end_time=time.time()
print 'time=%.2fsecs'%(end_time-start_time) 作者: 散不开暧昧 时间: 2017-12-28 11:11
谢谢老铁,顶你!作者: TED 时间: 2017-12-28 13:29
散不开暧昧 发表于 2017-12-28 11:09
# -*- coding:utf-8 -*-
import random
import time