python ascii 排序 sorted默认排序
图片整理
http://www.nowcoder.com/questionTerminal/2de4127fda5e46858aa85d254af43941
大神答案。
sorted对字符串str 对排序默认是按照ascii码进行排序。
while True:
try:
print("".join(sorted(input())))
except:
break个人答案,测试时间超过2秒。
while True:
try:
in_str=input()
in_list = [x for x in in_str]
out_list = sorted(in_list,key = ord)
out_str =''.join(out_list)
print(out_str)
except:
pass
360集团公司氛围 420人发布