题解 | 字符串排序
字符串排序
https://www.nowcoder.com/practice/5af18ba2eb45443aa91a11e848aa6723
n = int(input())
s = []
for i in range(0,n,1):
word = input()
s.append(word)
new_s = sorted(s) # 用sorted()排序
for i in new_s:
print(i)
字符串排序
https://www.nowcoder.com/practice/5af18ba2eb45443aa91a11e848aa6723
n = int(input())
s = []
for i in range(0,n,1):
word = input()
s.append(word)
new_s = sorted(s) # 用sorted()排序
for i in new_s:
print(i)
相关推荐