Python_Prog

| challenge 1

Feb 25th, 2012
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. import sys
  2.  
  3. def main():
  4.     try:
  5.         p = sys.argv[1:]
  6.     except IndexError:
  7.         sys.exit("herp")
  8.     n = []
  9.     while p:
  10.         l = 0
  11.         for y in [int(x) for x in p]:
  12.             if y > l:
  13.                 l = y
  14.         p.remove(str(l))
  15.         n.append(l)
  16.     n.reverse()
  17.     print(" ".join([str(x) for x in n]))
  18.    
  19. if __name__ == "__main__":
  20.     main()
Advertisement
Add Comment
Please, Sign In to add comment