#38381: 套件解法解法


115205@tchcvs.tw (114級115205資2班.張楷昊)

學校 : 國立臺中高級家事商業職業學校
編號 : 233256
來源 : [111.252.111.133]
最後登入時間 :
2024-04-24 15:22:06
a524. 手機之謎 | From: [61.218.155.121] | 發表日期 : 2023-11-17 13:47

from itertools import permutations#引入套件
try:#讀取多冊資
    while 1:
        a=int(input())
        aa=list(range(1,a+1))
        aa.sort(reverse=True)
        for i in permutations(aa,a):#使用套件瓊舉
            print("".join(tuple(map(str,i))))
except:
    pass

#套件使用說明:https://docs.python.org/zh-cn/3/library/itertools.html

 
ZeroJudge Forum