题解 | #字符串最后一个单词的长度#

明明的随机数

http://www.nowcoder.com/practice/3245215fffb84b7b81285493eae92ff0

num = input() message = [] for i in range(0,int(num)): message = message + [input()] j = [] for i in range(0,len(message)): if not message[i] in j: j = j + [message[i]]

print(j)

for k in range(0,len(j)): for t in range(k,len(j)): if int(j[k]) > int(j[t]): temp = j[k] j[k] = j[t] j[t] = temp
for a in j: print(a)

全部评论

相关推荐

评论
点赞
收藏
分享
牛客网
牛客企业服务