improve chapter 6 readability
add chapter06.cpp
Merge pull request #54 from Boshen/chapter06

add chapter 6 cpp code and improve readability