Update calc.cpp

I have changed the code.