Lesnic

Untitled

Jan 22nd, 2021
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. instr = sorted(filter(lambda x: x != 0, [int(i) for i in input().split(',')]))
  2. pos = 1
  3. neg = 1
  4. lessneg = 0
  5. for i in instr:
  6.     if i > 0:
  7.         pos *= i
  8.     else:
  9.         neg *= i
  10.         lessneg = i
  11. if neg > 0:
  12.     print(pos * neg)
  13. else:
  14.     print(pos * (neg // lessneg))
  15. print('f')
  16.  
Advertisement
Add Comment
Please, Sign In to add comment