From 402d7178dc5e8bb893cc03fae1a7b59517583372 Mon Sep 17 00:00:00 2001 From: shariik Date: Mon, 15 Dec 2025 13:27:01 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=2011=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=B0=D0=B3=D1=80=D0=B0=D1=84=202.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2.2_lesson.11.20.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 2.2_lesson.11.20.py diff --git a/2.2_lesson.11.20.py b/2.2_lesson.11.20.py new file mode 100644 index 0000000..f449571 --- /dev/null +++ b/2.2_lesson.11.20.py @@ -0,0 +1,21 @@ +****Задание 11 Параграф 2.2*** +***Напишите программу, которая проверяет, является ли число красивым.*** + +if name == "main": + num = int(input()) + + first = num // 100 + second = num // 10 % 10 + third = num % 10 + + if max(first, second, third) != first and min(first, second, third) != first: + middle = first + elif max(first, second, third) != second and min(first, second, third) != second: + middle = second + else: + middle = third + + if max(first, second, third) + min(first, second, third) == middle * 2: + print('YES') + else: + print('NO')