while True:
try:
a = input()
b = input()
k = b.split()
y = sorted(k, reverse=False)
for h in y:
print(h, end=" ")
print()
except:
break
while True: try: a = input() b = input() k = b.split() y = sorted(k, reverse=False) for h in y: print(h, end=" ") print() except: break
換整數在排序,字串的排序法不太一樣
而且他是EOF結束