题解 | #字符串排序#
字符串排序
http://www.nowcoder.com/practice/5af18ba2eb45443aa91a11e848aa6723
方法1
num = int(input()) in_list = [input() for x in range(num)] in_list_s = [] in_list_s = sorted(in_list) for x in in_list_s: print(x)
方法2:
n = int(input()) L = [] for i in range(n): L.append(input()) L.sort() for x in L: print(x)