转自:http://www.cnblogs.com/CBDoctor/archive/2012/08/19/2646171.html 《程序员面试宝典》上的一道题。 转载于:https://www.cnblogs.com/lordcheng/p/7434805.html