computecost in c++