# # Код на ruby 2.2.3p173
def zadanie(height_start, height_end, increment )
height = height_start
months = 0
while height lt;= height_end do
height = height * (1 + increment)
months = months + 1
end
return months
end
# Примеры применения
p zadanie(120, 150, 0.02)
p zadanie(120, 150, 0.03)
Ответ 12 месяцев