C++example: use virtual function to design draw picture function