Completed answer05.c, passed all tests