Solve shortest temperatures

This commit is contained in:
Gabriel Augendre 2017-08-28 14:57:46 +02:00
parent d939963237
commit 8605fbd547
No known key found for this signature in database
GPG key ID: F360212F958357D4

11
temperature_shortest.py Normal file
View file

@ -0,0 +1,11 @@
from math import fabs as f
N=int(input())
if N==0:
print(0)
exit(0)
T=map(int, input().split())
b=next(T)
for t in T:
if f(t)<f(b):b=t
if b<0 and f(b)==t:b=t
print(b)