add 0031.cpp, 0032.cpp and 0046.cpp