当前位置:网站首页>String sorting
String sorting
2022-04-23 15:40:00 【Ye Ningxia Xin】
describe
Given n A string , Yes, please. n Strings in dictionary order .
Data range : 1≤n≤1000 , The string length satisfies 1≤len≤100
Input description :
Enter the first line as a positive integer n(1≤n≤1000), below n Behavior n A string ( String length ≤100), The string contains only uppercase and lowercase letters .
Output description :
Data output n That's ok , The output is a string in dictionary order .
Example 1
Input :
9 cap to cat card two too up boat boot
Output :
boat boot cap card cat to too two up
n = int(input())
list = []
if 1 <= n <= 1000 :
for i in range(n):
b = input()
if 1 <= len(b) <= 100:
list.append(b)
list.sort()
# for j in list:
# print(j)
print('\n'.join(list))
Python Medium .join() usage _chixujohnny The blog of -CSDN Blog _.join()
版权声明
本文为[Ye Ningxia Xin]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231534071476.html
边栏推荐
- Date date calculation in shell script
- 一刷312-简单重复set-剑指 Offer 03. 数组中重复的数字(e)
- Application of Bloom filter in 100 million flow e-commerce system
- Upgrade MySQL 5.1 to 5.66
- pywintypes.com_error: (-2147221020, ‘无效的语法‘, None, None)
- For examination
- 【AI周报】英伟达用AI设计芯片;不完美的Transformer要克服自注意力的理论缺陷
- Knn,Kmeans和GMM
- MySQL集群模式與應用場景
- 多生成树MSTP的配置
猜你喜欢
随机推荐
ICE -- 源码分析
How to test mobile app?
fatal error: torch/extension.h: No such file or directory
MySQL Cluster Mode and application scenario
删除字符串中出现次数最少的字符
Single architecture system re architecture
Date date calculation in shell script
怎么看基金是不是reits,通过银行购买基金安全吗
Upgrade MySQL 5.1 to 5.66
移动app测试如何进行?
一刷313-剑指 Offer 06. 从尾到头打印链表(e)
移动app软件测试工具有哪些?第三方软件测评小编分享
自主作业智慧农场创新论坛
Openstack command operation
utils.DeprecatedIn35 因升级可能取消,该如何办
Recommended search common evaluation indicators
pgpool-II 4.3 中文手册 - 入门教程
Go语言切片,范围,集合
Redis master-slave replication process
Upgrade MySQL 5.1 to 5.68