How to easily have a project where you can compile multiple cpps (for competitve programming) using VS2022 
First you create an empty project:
You create your new cpp file and start work with it (I mean to finish your problem) π₯οΈ
Here you can see how you create a new cpp file:
-First go to Source files right click and press "Add" and "New item" or hit on your keyboard "CTRL+SHIFT+A"
-Select "C++ File(.cpp) and give it a name
After you finish up the problem (I hope it got accepted π) you set the property exclude from build to that cpp to "YES" and start to work on another problem
To do that your right click the cpp in the explorer window, hit properties and set exclude from build to "YES"
Here you can see how:
Of course it is reversible and you can anytime set it back to "NO", but pay attention to have everytime just only one them set to "NO" because if not you will get an error (you can only have one main function π), so long story short, you should have set to "NO"the one you want to work and compile on and the rest of thme set to "YES", and you just switch from one and another.
Here is a little example: