Finish the basic function to calculate and solve the problem.
Finish the basic function to calculate and solve the problem.