当前位置:网站首页>字符串排序
字符串排序
2022-04-23 15:34:00 【叶宁夏昕】
描述
给定 n 个字符串,请对 n 个字符串按照字典序排列。
数据范围: 1≤n≤1000 ,字符串长度满足 1≤len≤100
输入描述:
输入第一行为一个正整数n(1≤n≤1000),下面n行为n个字符串(字符串长度≤100),字符串中只含有大小写字母。
输出描述:
数据输出n行,输出结果为按照字典序排列的字符串。
示例1
输入:
9 cap to cat card two too up boat boot
输出:
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))
版权声明
本文为[叶宁夏昕]所创,转载请带上原文链接,感谢
https://blog.csdn.net/come_bn/article/details/124309602
边栏推荐
- What role does the software performance test report play? How much is the third-party test report charged?
- 字节面试 transformer相关问题 整理复盘
- ICE -- 源码分析
- Differential privacy (background)
- Comparaison du menu de l'illustrateur Adobe en chinois et en anglais
- adobe illustrator 菜单中英文对照
- 通过 PDO ODBC 将 PHP 连接到 MySQL
- 调度系统使用注意事项
- Common interview questions of operating system:
- 函数(第一部分)
猜你喜欢
regular expression
导入地址表分析(根据库文件名求出:导入函数数量、函数序号、函数名称)
Mysql database explanation (10)
Multitimer V2 reconstruction version | an infinitely scalable software timer
推荐搜索 常用评价指标
【AI周报】英伟达用AI设计芯片;不完美的Transformer要克服自注意力的理论缺陷
setcontext getcontext makecontext swapcontext
Mysql连接查询详解
Detailed explanation of MySQL connection query
For examination
随机推荐
开源项目推荐:3D点云处理软件ParaView,基于Qt和VTK
Modify the default listening IP of firebase emulators
el-tree实现只显示某一级复选框且单选
Use of common pod controller of kubernetes
Detailed explanation of kubernetes (IX) -- actual combat of creating pod with resource allocation list
Common interview questions of operating system:
MySQL Basics
pywintypes.com_error: (-2147221020, ‘无效的语法‘, None, None)
Node. JS ODBC connection PostgreSQL
Detailed explanation of kubernetes (XI) -- label and label selector
MySQL query library size
Mysql database explanation (IX)
Advantages, disadvantages and selection of activation function
After time judgment of date
Mobile finance (for personal use)
Educational codeforces round 127 A-E problem solution
Sorting and replying to questions related to transformer
What if the server is poisoned? How does the server prevent virus intrusion?
推荐搜索 常用评价指标
fatal error: torch/extension.h: No such file or directory