From 905f90933759d56d9e48808b5b36f498d2ad3317 Mon Sep 17 00:00:00 2001 From: user Date: Tue, 9 Dec 2025 14:53:54 +0500 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5=205?= =?UTF-8?q?=20=D0=B2=D1=8B=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8=D0=BB=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..859e6fa --- /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('Вася') \ No newline at end of file