Cpp for some problems