Use the concept of function override in C++ and create a function shape_area, which will calculate area of square, rectangle and a triangle. Override of the function should be controlled using the number of variables. In the main function you should demonstrate examples for all three cases of the shapes.