My answer to practice from c++ primer.