C++ codes for beginners