Homework of C++