Code for problem 85C.