this is my c++'s homework.