本文共 347 字,大约阅读时间需要 1 分钟。
numbers = int(input());count = 1;now = [str(i) for i in range(1,numbers+1)]while count < numbers: pre = now;now = [];strl = len(pre);count+=1 for i in range(1,numbers+1): for j in range(strl): if str(i) not in pre[j]:now.append(pre[j]+str(i))ret = [int(i) for i in now];ret.sort()for i in ret:print(i)
转载地址:http://fkni.baihongyu.com/