MC Code Based on C++