Thinking in C++ Vol2 2nd
in chapter 1, finish exercise 5m