Advertisement
Void-voiD

Untitled

Apr 3rd, 2023
632
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | Source Code | 0 0
  1. a = open('input.txt', 'r')
  2. b = open('output.txt', 'w')
  3. nums = a.readlines()
  4. mx = -10 ** 9
  5. mn = 10 ** 9
  6.  
  7. for x in nums:
  8.     x = int(x)
  9.     if x % 2 == 0 and x > 0:
  10.         if x > mx:
  11.             mx = x
  12.         if x < mn:
  13.             mn = x
  14.  
  15. if mx != -10 ** 9 and mn != 10 ** 9:
  16.     print(mn, mx, file=b, end='')
  17. else:
  18.     print(0, file=b, end='')
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement