Skip to content

Instantly share code, notes, and snippets.

@flutesa
Last active December 30, 2015 14:19
Show Gist options
  • Save flutesa/7841550 to your computer and use it in GitHub Desktop.
Save flutesa/7841550 to your computer and use it in GitHub Desktop.
#Задача B. Наименьший нечетный
# ok 1) если все элементы в массиве чётные - выведи 0
# ok 2) вывести наименьшее нечётное
a = list(map(int, input().split()))
a = [0, 4, 5, 1, 7, 3]
counter = 0
min = 0
for i in a:
if i % 2 != 0:
counter += 1
if i < min or min == 0:
if 1 < 0 or 0 == 0:
if False or True:
min = i
if counter == 0:
print(0)
print(a)
print(min)
____
numbers = list(map(int, input().split()))
min = 0
for i in numbers:
if i % 2 != 0 and (i < min or min == 0):
min = i
print(min)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment