当前位置:网站首页>HJ string sort
HJ string sort
2022-06-28 07:38:00 【Courageous steak】
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
Cattle guest HJ Python
# Input n、 initialization list
n,list =input(),[]
# Enter a string to list
while True:
try:
list.append(input())
except:
break
# Sort list, And output
for i in sorted(list):
print(i)
Link to the original text :
https://edit.920vip.net/#/articleId/179
边栏推荐
猜你喜欢

Kubernetes cluster lossless upgrade practice

8 figures | analyze Eureka's first synchronization registry

Leetcode+ 66 - 70 high precision, two sub topics

Construction and exploration of vivo database and storage platform

Section 5: zynq interrupt

HJ质数因子

本周二晚19:00战码先锋第8期直播丨如何多方位参与OpenHarmony开源贡献

PLC -- Notes

es6箭头函数中return的用法

异或的应用。(提取出数字中最右侧的1,面试中经常用的到)
随机推荐
The practice of event driven architecture in vivo content platform
Code submission specification
goland IDE和delve调试位于kubernetes集群中的go程序
R 语言 Hitters 数据分析
Ice, protobuf, thrift -- Notes
Kubelet garbage collection (exiting containers and unused images) source code analysis
HJ质数因子
本周二晚19:00战码先锋第8期直播丨如何多方位参与OpenHarmony开源贡献
Kubernetes theoretical basis
XML serialization backward compatible
Ice - resources
Devtools implementation principle and performance analysis practice
Section 5: zynq interrupt
8 figures | analyze Eureka's first synchronization registry
Vivo browser rapid development platform practice - Overview
云原生:云计算技术再次升级 开启全面云开发时代
同花顺网上开户安全吗
Makefile
es数据导出csv文件
How to configure DDR3 of dm8148