add source code

Added C++ source code.