Последовательность состоит из натуральных чисел и завершается числом 0. Определите значение наибольш
Python
# Инициализируем переменную для хранения наибольшего элемента
max_element = 0
# Считываем числа последовательности
while True:
number = int(input("Введите число (для завершения введите 0): "))
if number == 0:
break
if number > max_element:
max_element = number
# Выводим результат
print("Наибольший элемент последовательности:", max_element)
Output
Embed on website
To embed this program on your website, copy the following code and paste it into your website's HTML:
Comments
This comment belongs to a banned user and is only visible to admins.
This comment belongs to a deleted user and is only visible to admins.