Advertisement
ForestFox

3 task

Feb 4th, 2022
848
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. n = int(input())
  2. ma = "n"
  3. mi = "n"
  4. for i in range(n):
  5.     k = int(input())
  6.     if k == 0:
  7.         continue
  8.     if k < 0 and ma == 'n':
  9.         ma = k
  10.     elif k > 0 and mi == 'n':
  11.         mi = k
  12.     elif k > 0 and k < mi:
  13.         mi = k
  14.     elif k < 0 and k > ma:
  15.         ma = k
  16.        
  17. print(ma, mi)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement