懵懂的菜鸟

Stay hungry,Stay foolish.

导航

python 求第k个最大数

 1 #coding = utf-8
 2 import sys
 3 def Cal_NO(a,b):
 4     nums=sorted(a,reverse=True)
 5     result=nums[b-1]
 6     return result
 7 
 8 if __name__=='__main__':
 9 
10     a=[int(i) for i in sys.stdin.readline().split(' ')]
11     b = int(input())
12     print(Cal_NO(a,b))

 

posted on 2017-08-26 16:23  懵懂的菜鸟  阅读(462)  评论(0编辑  收藏  举报