当前位置:网站首页>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
边栏推荐
- Upgrade MySQL 5.1 to 5.66
- Advantages, disadvantages and selection of activation function
- Upgrade MySQL 5.1 to 5.69
- Pytorch中named_parameters、named_children、named_modules函数
- 北京某信护网蓝队面试题目
- shell脚本中的DATE日期计算
- Openstack theoretical knowledge
- [leetcode daily question] install fence
- 如果conda找不到想要安装的库怎么办PackagesNotFoundError: The following packages are not available from current
- Sorting and replying to questions related to transformer
猜你喜欢
随机推荐
Openstack command operation
【递归之数的拆分】n分k,限定范围的拆分
Go语言数组,指针,结构体
Common types of automated testing framework ▏ automated testing is handed over to software evaluation institutions
单体架构系统重新架构
激活函数的优缺点和选择
mysql乐观锁解决并发冲突
Summary of interfaces for JDBC and servlet to write CRUD
PHP classes and objects
Go语言切片,范围,集合
负载均衡器
Why disable foreign key constraints
Demonstration meeting on startup and implementation scheme of swarm intelligence autonomous operation smart farm project
山寨版归并【上】
Configuration of multi spanning tree MSTP
Sorting and replying to questions related to transformer
Explanation of redis database (IV) master-slave replication, sentinel and cluster
大型互联网为什么禁止ip直连
Load Balancer
电脑怎么重装系统后显示器没有信号了