题目:
示例一:
9
cap
to
cat
card
two
too
up
boat
boot
输出:
boat
boot
cap
card
cat
to
too
two
up
解题方法:
n = int(input())
li = []
# 循环接收n个字符串,并添加到列表li里
for i in range(n):
li.append(input())
# 将列表li重新排序,并依次输出
for i in sorted(li):
print(i)
题目:
示例一:
9
cap
to
cat
card
two
too
up
boat
boot
输出:
boat
boot
cap
card
cat
to
too
two
up
解题方法:
n = int(input())
li = []
# 循环接收n个字符串,并添加到列表li里
for i in range(n):
li.append(input())
# 将列表li重新排序,并依次输出
for i in sorted(li):
print(i)