字符串排序3 题解:Python
1261 AC
while True:
try:
string = []
n = int(input())
for i in range(n):
sentence = input()
if sentence == "stop":
break
else:
string.append(sentence)
sorted_string = sorted(string,key = lambda x:len(x))
for s in sorted_string:
print(s)
except:
break
登录后发布评论
暂无评论,来抢沙发