专题博客链接
[题解]浙大Python PTA课后习题博客记录(Python)
原题题目
代码实现
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)