当前位置:网站首页>字符串排序
字符串排序
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
边栏推荐
- After time judgment of date
- Nacos程序连接MySQL8.0+ NullPointerException
- utils.DeprecatedIn35 因升级可能取消,该如何办
- 移动金融(自用)
- 使用 Bitnami PostgreSQL Docker 镜像快速设置流复制集群
- Common types of automated testing framework ▏ automated testing is handed over to software evaluation institutions
- Knn,Kmeans和GMM
- About UDP receiving ICMP port unreachable
- SSH connects to the remote host through the springboard machine
- Independent operation smart farm Innovation Forum
猜你喜欢

【Leetcode-每日一题】安装栅栏

T2 icloud calendar cannot be synchronized

c语言---指针进阶

Kubernetes详解(十一)——标签与标签选择器

TLS / SSL protocol details (28) differences between TLS 1.0, TLS 1.1 and TLS 1.2

regular expression

setcontext getcontext makecontext swapcontext

MultiTimer v2 重构版本 | 一款可无限扩展的软件定时器

How did the computer reinstall the system? The display has no signal

My raspberry PI zero 2W toss notes to record some problems and solutions
随机推荐
MySQL Basics
MySQL query library size
G007-hwy-cc-estor-03 Huawei Dorado V6 storage simulator construction
PHP PDO ODBC loads files from one folder into the blob column of MySQL database and downloads the blob column to another folder
函数(第一部分)
网站某个按钮样式爬取片段
Deeply learn the skills of parameter adjustment
Cookie&Session
After time judgment of date
fatal error: torch/extension.h: No such file or directory
Crawling fragment of a button style on a website
CVPR 2022 优质论文分享
移动app测试如何进行?
服务器中毒了怎么办?服务器怎么防止病毒入侵?
Mysql database explanation (VII)
Connect PHP to MSSQL via PDO ODBC
网站压测工具Apache-ab,webbench,Apache-Jemeter
Special analysis of China's digital technology in 2022
Multitimer V2 reconstruction version | an infinitely scalable software timer
Introduction to dynamic programming of leetcode learning plan day3 (198213740)