Пример 4 и сделайте по образу и подобию

http://www.sch5.stavedu.ru/naprdeat/metodr...-podggiatearver