标签:gen blog nbsp tor style cto other 优惠 imp
1 import random 2 import sys 3 import stdarray 4 import stdio 5 6 n = int(sys.argv[1]) 7 count = 0 8 collectedCount = 0 9 isCollected = stdarray.create1D(n, False) 10 while collectedCount < n: 11 #Generate another coupon. 12 value = random.randrange(0,n) 13 count += 1 14 if not isCollected[value]: 15 collectedCount += 1 16 isCollected[value] = True 17 stdio.write(count)
标签:gen blog nbsp tor style cto other 优惠 imp
原文地址:http://www.cnblogs.com/cdf4745/p/7263839.html