C++ code of the calculation

A necessary hint for the calculation