From a83198767ad4eab0b2a76c4d83e644cb305aa313 Mon Sep 17 00:00:00 2001 From: shariik Date: Mon, 15 Dec 2025 13:50:02 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=204=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=B0=D0=B3=D1=80=D0=B0=D1=84=202.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2.3_lesson.4.20.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 2.3_lesson.4.20.py diff --git a/2.3_lesson.4.20.py b/2.3_lesson.4.20.py new file mode 100644 index 0000000..f81e5f4 --- /dev/null +++ b/2.3_lesson.4.20.py @@ -0,0 +1,16 @@ +****Задание 4 Параграф 2.3*** +**** К вам снова пришли за помощью: нужна программа, которая посчитает сумму всех цифр всех чисел, поданных на вход. +Вы справитесь — у вас ведь уже есть всё необходимое: циклы и уверенность в своих силах!**** + +if name == "main": + count = int(input()) + + summa = 0 + + for _ in range(count): + number = int(input()) + while number > 0: + summa += number % 10 + number //= 10 + + print(summa) \ No newline at end of file