当前位置:网站首页>字符串排序
字符串排序
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
边栏推荐
- el-tree实现只显示某一级复选框且单选
- 推荐搜索 常用评价指标
- The El tree implementation only displays a certain level of check boxes and selects radio
- Educational codeforces round 127 A-E problem solution
- 服务器中毒了怎么办?服务器怎么防止病毒入侵?
- 软件性能测试报告起着什么作用?第三方测试报告如何收费?
- Code live collection ▏ software test report template Fan Wen is here
- 通过 PDO ODBC 将 PHP 连接到 MSSQL
- JSON date time date format
- Tun model of flannel principle
猜你喜欢
X509 certificate cer format to PEM format
G007-hwy-cc-estor-03 Huawei Dorado V6 storage simulator construction
木木一路走好呀
Machine learning - logistic regression
考试考试自用
Mysql database explanation (8)
Special analysis of China's digital technology in 2022
Knn,Kmeans和GMM
导入地址表分析(根据库文件名求出:导入函数数量、函数序号、函数名称)
【Leetcode-每日一题】安装栅栏
随机推荐
2022年中国数字科技专题分析
如果conda找不到想要安装的库怎么办PackagesNotFoundError: The following packages are not available from current
Openstack command operation
Squid agent
Krpano panorama vtour folder and tour
What is CNAs certification? What are the software evaluation centers recognized by CNAs?
Mysql database explanation (10)
Explanation of redis database (IV) master-slave replication, sentinel and cluster
Common interview questions of operating system:
TLS / SSL protocol details (28) differences between TLS 1.0, TLS 1.1 and TLS 1.2
码住收藏▏软件测试报告模板范文来了
字节面试 transformer相关问题 整理复盘
Error: unable to find remote key "17f718f726"“
控制结构(二)
MySQL installation process (steps for successful installation)
Cookie&Session
G007-HWY-CC-ESTOR-03 华为 Dorado V6 存储仿真器搭建
What if the package cannot be found
MultiTimer v2 重构版本 | 一款可无限扩展的软件定时器
软件性能测试报告起着什么作用?第三方测试报告如何收费?