POJ 3434 Terrarium:題目解答源碼

      POJ 3434 Terrarium:題目解答源碼

      A zoology research lab has a terrarium with rare species of snakes.Terrarium is a flat box filled with soil,and has a glass top allowing to watch the snakes.There are trenches in the soil,and snakes constantly move along the trenches.All snakes have diameter of 1 cm and integer length of no less than 2 cm.

      While watching the snakes,the zoologists discovered a pattern in their movement:each snake moves at a speed of 1 cm per second forward,until it encounters either a wall or another snake.Faced an obstacle,snake first tries to turn right,if there is also obstacle on the right,then it tries to turn left.If there is obstacle on the left also,the snake waits for a second before trying to move again.

      程序源碼

      源代碼如下:

1.png

      點擊瞭解完整源代碼!


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章