mins = "нет"
while 1:
a = int(input())
if a == 0: break
elif a % 3 == 0:
if mins == "нет":
mins = a
elif mins <= a:
print(mins)
k = 0
max = 0
n = int(input())
while n != 0:
if n % 3 == 0:
if n > max:
max = n
k += 1
if k > 0:
print(max)
else:
print('нет')
Объяснение:
mins = "нет"
while 1:
a = int(input())
if a == 0: break
elif a % 3 == 0:
if mins == "нет":
mins = a
elif mins <= a:
mins = a
print(mins)
k = 0
max = 0
n = int(input())
while n != 0:
if n % 3 == 0:
if n > max:
max = n
k += 1
n = int(input())
if k > 0:
print(max)
else:
print('нет')
Объяснение: