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

21 lines
925 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.

****Задание 9 Параграф 2.3***
**** С каждым заданием вы становитесь всё опытнее — и теперь готовы собрать по-настоящему большое число.
Дети в детском саду снова придумали игру: каждый называет число, составленное из тех цифр, которые он знает.
А потом они собирают общее число, выбирая из каждого названого числа самую большую цифру.****
if name == "main":
count = int(input())
result = 0
for _ in range(count):
number = int(input())
maximum = -1
while number > 0:
if number % 10 > maximum:
maximum = number % 10
number //= 10
result = result * 10 + maximum
print(result)