aneliabogeva

Largest N Elements

Jun 18th, 2019
130
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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=" ")
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×