update ex1.38 (use quotient)