project_python/2.3_lesson.10.20.py
2025-12-15 13:55:50 +05:00

18 lines
997 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

****Задание 10 Параграф 2.3***
**** Вы добрались до половины всей главы — уже 10 задач из 20 пройдены!
Это отличный момент, чтобы похвалить себя, сделать перерыв или… нырнуть сразу в новую задачу.
Аня, Боря и Вова решили съесть апельсин. Но просто так — неинтересно!
Они хотят узнать все возможные способы, как можно его разделить между собой по справедливости.****
if name == "main":
# Решение наивное, для демонстрации сути метода
slices = int(input())
print('А Б В')
for a in range(1, slices + 1):
for b in range(1, slices + 1):
for c in range(1, slices + 1):
if a + b + c == slices:
print(a, b, c)