Last active
December 30, 2015 14:19
-
-
Save flutesa/7841550 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Задача 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