(см. объяснение)
Объяснение:
Решим задачу с Python 3:
k = 0
for x1 in range(2):
for x2 in range(2):
for x3 in range(2):
for x4 in range(2):
for x5 in range(2):
for x6 in range(2):
for x7 in range(2):
for x8 in range(2):
for x9 in range(2):
for x10 in range(2):
if (((x1 == x2) and (x3 == x4)) or (
not (x1 == x2) and not (x3 == x4)) == 0) and (
((x3 == x4) and (x5 == x6)) or (
not (x3 == x4) and not (x5 == x6)) == 0) and (
((x5 == x6) and (x7 == x8)) or (
not (x5 == x6) and not (x7 == x8)) == 0) and (
((x7 == x8) and (x9 == x10)) or (
not (x7 == x8) and not (x9 == x10)) == 0):
k += 1
print(k)
Результат работы программы: 416.
Задание выполнено!
(см. объяснение)
Объяснение:
Решим задачу с Python 3:
k = 0
for x1 in range(2):
for x2 in range(2):
for x3 in range(2):
for x4 in range(2):
for x5 in range(2):
for x6 in range(2):
for x7 in range(2):
for x8 in range(2):
for x9 in range(2):
for x10 in range(2):
if (((x1 == x2) and (x3 == x4)) or (
not (x1 == x2) and not (x3 == x4)) == 0) and (
((x3 == x4) and (x5 == x6)) or (
not (x3 == x4) and not (x5 == x6)) == 0) and (
((x5 == x6) and (x7 == x8)) or (
not (x5 == x6) and not (x7 == x8)) == 0) and (
((x7 == x8) and (x9 == x10)) or (
not (x7 == x8) and not (x9 == x10)) == 0):
k += 1
print(k)
Результат работы программы: 416.
Задание выполнено!