C++ coarse work