From 65f65e5657b4d77dacdae6d9b63509581773d13e Mon Sep 17 00:00:00 2001 From: shariik Date: Mon, 15 Dec 2025 13:22:39 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=205=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.5.20.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 2.2_lesson.5.20.py diff --git a/2.2_lesson.5.20.py b/2.2_lesson.5.20.py new file mode 100644 index 0000000..ca50c3e --- /dev/null +++ b/2.2_lesson.5.20.py @@ -0,0 +1,31 @@ +****Задание 5 Параграф 2.2*** +****У Пети было 7 яблок, а у Васи 6. + +Затем Петя отдал 3 яблока Васе, а у Толи взял 2 яблока. + +Вася попросил у Толи 5 яблок, но отдал Гене 2. + +Затем Дима дал Пете +N +N яблок, а Васе +M +M. + +Так у кого в итоге яблок больше — у Пети или Васи?**** + + + +if name == "main": + petya = 7 + vasya = 6 + + n_apples = int(input()) + m_apples = int(input()) + + petya = petya - 3 + 2 + n_apples + vasya = vasya + 3 + 5 - 2 + m_apples + + if petya > vasya: + print('Петя') + elif vasya > petya: + print('Вася')