add chapter 25 cpp code and improve readability