chapter 5 exercise 5-9: separate inputs to lowercase and upper case characters