Выполните задание. На бесконечном поле имеются две одинаковые горизонтальные стены и одна вертикальная, соединяющая левые концы стен. Длины стен неизвестны. Робот находится в одной из клеток, расположенных между правыми краями горизонтальных стен.
На рисунке указан один из возможных расположения стен и Робота (Робот обозначен буквой «Р»).
Напишите для Робота алгоритм, закрашивающий все клетки, расположенные левее вертикальной стены непосредственно рядом с ней. Робот должен закрасить только клетки, удовлетворяющие данному условию. Например, для приведённого выше рисунка Робот должен закрасить следующие клетки (см. рисунок).
Конечное расположение Робота может быть произвольным. Алгоритм должен решать задачу для произвольного размера поля и любого допустимого расположения стен внутри прямоугольного поля. При исполнении алгоритма Робот не должен разрушиться, выполнение алгоритма должно завершиться.
Автор Arthur Hailey. название Airport 1)The agent asked if that was his luggage (стр 7) 2) Inez asked the driver how much the taxi to the airport was (стр 7) 3) The driver said that he would take her for seven (стр 7) 4) The girl said that that man really did not have much time (стр 8) 5) The girl asked the man what kind of policy he had been considering (стр 8) 6) Mr. Guerrero said that he had left his checkbook at home (стр 8) 7)The officer answered that was Trans America Two (стр 9) 8) The officer said that they would turn back (стр 10) 9) Harris said that they would ask Gwen to locate that fellow (стр 10) 10) Capitan Demerest asked Mrs Quonset to come in (стр 11) 11) Gwen told Ada to sit down and be quiet (стр 12)
Автор Arthur Hailey. название Airport 1)The agent asked if that was his luggage (стр 7) 2) Inez asked the driver how much the taxi to the airport was (стр 7) 3) The driver said that he would take her for seven (стр 7) 4) The girl said that that man really did not have much time (стр 8) 5) The girl asked the man what kind of policy he had been considering (стр 8) 6) Mr. Guerrero said that he had left his checkbook at home (стр 8) 7)The officer answered that was Trans America Two (стр 9) 8) The officer said that they would turn back (стр 10) 9) Harris said that they would ask Gwen to locate that fellow (стр 10) 10) Capitan Demerest asked Mrs Quonset to come in (стр 11) 11) Gwen told Ada to sit down and be quiet (стр 12)
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota
Оформи подписку