Homework sol. for ZhuHongming's C++ courses