Advertisement
Aozzi

Untitled

Oct 17th, 2021
1,090
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. input()
  2. l = input().split()
  3. closest = 999999999999
  4. if l == []:
  5.     closest = 0
  6. for i in l:
  7.     i = int(i)
  8.     if abs(i)<abs(closest):
  9.         closest = i
  10.     elif abs(i) == abs(closest):
  11.         closest = max(i,closest)
  12. print(closest)
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement