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