add problem3-24 solution