The purpose of this thesis is to study the plagiarism detection method aiming at C/C++ programs. We propose corresponding preventive measures by summarizing the common types of plagiarism attack through observation and statistical analysis. Using text analysis, structure analysis, and variable analysis would prevent misjudgment. Finally, we implement the CPD system and compare it with other existing systems, and the experimental results shows us that our system can detect more kinds of plagiarism attacks than other existing systems.