题意:
浏览网页,这里有几种操作:
BACK: Push the current page on the top of the forward stack. Pop the page from the top of the backward stack, making it the new current page. If the backward stack is empty, the command is ignored.
FORWARD: Push the current page on the top of the backward stack. Pop the page from the top of the forward stack, making it the new current page. If the forward stack is empty, the command is ignored.
VISIT : Push the current page on the top of the backward stack, and make the URL specified the new current page. The forward stack is emptied.
QUIT: Quit the browser.
思路:模拟.设置一个字符串数组,用一个指针指向当前指向的网页,根据操作移动,唯一注意的是:执行VISIT时,前面的网页清空.
代码: