Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import math
- n = int(input()) # the number of temperatures to analyse
- closest_temp = 5527
- closest_real_temp = 0
- unsign_temp = 0
- for i in input().split():
- # t: a temperature expressed as an integer ranging from -273 to 5526
- t = int(i)
- if t > 0 and closest_real_temp < 0:
- if -t == closest_real_temp:
- closest_real_temp = t
- else:
- if t < 0:
- unsign_temp = -t
- else:
- unsign_temp = t
- if unsign_temp < closest_temp:
- closest_temp = unsign_temp
- closest_real_temp = t
- print(closest_real_temp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement