|
发表于 2020-5-16 03:47:07
|
显示全部楼层
- def daily384(s="owoztneoerzeorthreeseven"):
- k = ["zero", "one", "two", "three", "four", "five", "six", "seven", "night"]
- total = {}
- hashstr = []
- for i in k:
- for j in i:
- if j not in hashstr:
- hashstr.append(j)
- for i in s:
- total.setdefault(i, 0)
- total[i] += 1
- b = [0] * len(k)
- str_list = list(s)
- while len(str_list) != 0:
- for a, i in enumerate(k):
- downflow = False
- for j in i:
- total.setdefault(j, 0)
- total[j] -= 1
- if total[j] < 0:
- downflow = True
- if downflow:
- for j in i:
- total[j] += 1
- else:
- for j in i:
- str_list.remove(j)
- b[a] += 1
- for i, j in enumerate(b):
- print(str(i) * j, end="")
- daily384()
复制代码 |
|