Cpp's homework