I think the second one is best. If you want to have a rectangle class that is. But you should use a more descriptive name for the function. set_values could be called set_size, set_dimensions or something like that.
In the first one the Rectangle class is pointless. All data that is needed to calculate the result is passed to the function so it would be better to just make it a normal function.
so youre saying in the first one that it is like a normal function and the class is all useless and also its like not having a private data members ty ty ty