题解 | #字符串排序#
字符串排序
https://www.nowcoder.com/practice/5af18ba2eb45443aa91a11e848aa6723
n = int(input()) #要输入几个字符串 list_str = [] #初始化一个空列表 for i in range(n): #循环n次 str = input() # 输入字符串 list_str.append(str) # 字符串加入到列表里 list_str.sort() # 对列表里元素进行正序排列 #循环打印出来 for k in list_str: print(k)