Below are some sample runs of a solution to the problem

john@vega:(~/CS1500) a.out I can make a fence with from 2 to 18 posts. How many posts would you like to have in your fence? 1 Sorry, no can do. john@vega:(~/CS1500) a.out I can make a fence with from 2 to 18 posts. How many posts would you like to have in your fence? 0 Sorry, no can do. john@vega:(~/CS1500) a.out I can make a fence with from 2 to 18 posts. How many posts would you like to have in your fence? -23 Sorry, no can do. john@vega:(~/CS1500) a.out I can make a fence with from 2 to 18 posts. How many posts would you like to have in your fence? 2 |---| |---| john@vega:(~/CS1500) a.out I can make a fence with from 2 to 18 posts. How many posts would you like to have in your fence? 3 |---|---| |---|---| john@vega:(~/CS1500) a.out I can make a fence with from 2 to 18 posts. How many posts would you like to have in your fence? 12 |---|---|---|---|---|---|---|---|---|---|---| |---|---|---|---|---|---|---|---|---|---|---| john@vega:(~/CS1500) a.out I can make a fence with from 2 to 18 posts. How many posts would you like to have in your fence? 18 |---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| |---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| john@vega:(~/CS1500) a.out I can make a fence with from 2 to 18 posts. How many posts would you like to have in your fence? 19 Sorry, no can do. john@vega:(~/CS1500) a.out I can make a fence with from 2 to 18 posts. How many posts would you like to have in your fence? 20 Sorry, no can do. john@vega:(~/CS1500)