_maxDigit = -1
n = int(input())
while n > 0:
if n % 2 == 0 and n % 10 > _maxDigit:
_maxDigit = n % 10
n //= 10
if _maxDigit == -1:
print("NO")
else:
print(_maxDigit)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
_maxDigit = -1
n = int(input())
while n > 0:
if n % 2 == 0 and n % 10 > _maxDigit:
_maxDigit = n % 10
n //= 10
if _maxDigit == -1:
print("NO")
else:
print(_maxDigit)