scripts/ege/11_Основная волна. Первый день/Файлы к заданиям-20230222T110948Z-001/Файлы к заданиям/8.py
2023-05-05 00:45:01 +03:00

24 lines
773 B
Python

alf = "01234567"
nc = ["1", "3", "5", "7"]
cnt = 0
for a in alf[1:]:
for b in alf:
for c in alf:
for d in alf:
for e in alf:
w = a + b + c + d + e
if w.count("6") == 1:
if a == "6":
if b not in nc:
cnt += 1
elif e == "6":
if d not in nc:
cnt += 1
else:
mnc = w[w.index("6") - 1]
mxc = w[w.index("6") + 1]
if mnc not in nc and mxc not in nc:
cnt += 1
print(cnt)