Finish homework6.c