当前位置:网站首页>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
边栏推荐
- Squid agent
- Why disable foreign key constraints
- Machine learning - logistic regression
- Pytorch中named_parameters、named_children、named_modules函数
- Cookie&Session
- Mysql database explanation (IX)
- 电脑怎么重装系统后显示器没有信号了
- php类与对象
- MySQL optimistic lock to solve concurrency conflict
- Special analysis of China's digital technology in 2022
猜你喜欢
随机推荐
mysql乐观锁解决并发冲突
Cap theorem
网站压测工具Apache-ab,webbench,Apache-Jemeter
PHP operators
Control structure (I)
CVPR 2022 优质论文分享
导入地址表分析(根据库文件名求出:导入函数数量、函数序号、函数名称)
时序模型:门控循环单元网络(GRU)
For examination
Node. JS ODBC connection PostgreSQL
Connect PHP to MySQL via PDO ODBC
CAP定理
Mysql database explanation (10)
WPS品牌再升级专注国内,另两款国产软件低调出国门,却遭禁令
Detailed explanation of redirection and request forwarding
Pytorch中named_parameters、named_children、named_modules函数
Cookie&Session
YML references other variables
现在做自媒体能赚钱吗?看完这篇文章你就明白了
电脑怎么重装系统后显示器没有信号了