a = []b = int(input())c = []d = []while True:try:while len(a) < b:a = input().split()for i in a:c.append(int(i))c.sort()for j in c:d.append(str(j))e = " ".join(d)print(e)except EOFError:break無法再次跳到第二個while
另外其實不一定要用for迴圈轉換型態,可以用map