Advertisement
aneliabogeva

Largest N Elements

Jun 18th, 2019
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. nums = [int(item) for item in input().split(" ")]
  2.  
  3. count = int(input())
  4.  
  5. nums.sort(reverse=True)
  6.  
  7. start = 0
  8. sorted_nums = []
  9.  
  10. while count != 0:
  11. sorted_nums += [nums[start]]
  12. start += 1
  13. count -= 1
  14.  
  15. for num in sorted_nums:
  16. print(num, end=" ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement